1#![doc = "MAVLink cubepilot dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::{bitflags, Flags};
9use mavlink_core::{
10 bytes::Bytes, bytes_mut::BytesMut, types::CharArray, MavlinkVersion, Message, MessageData,
11};
12#[allow(unused_imports)]
13use num_derive::FromPrimitive;
14#[allow(unused_imports)]
15use num_derive::ToPrimitive;
16#[allow(unused_imports)]
17use num_traits::FromPrimitive;
18#[allow(unused_imports)]
19use num_traits::ToPrimitive;
20#[cfg(feature = "serde")]
21use serde::{Deserialize, Serialize};
22#[cfg(feature = "ts")]
23use ts_rs::TS;
24pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
25#[cfg_attr(feature = "ts", derive(TS))]
26#[cfg_attr(feature = "ts", ts(export))]
27#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
28#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29#[cfg_attr(feature = "serde", serde(tag = "type"))]
30#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31#[repr(u32)]
32#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
33pub enum ActuatorConfiguration {
34 #[doc = "Do nothing."]
35 ACTUATOR_CONFIGURATION_NONE = 0,
36 #[doc = "Command the actuator to beep now."]
37 ACTUATOR_CONFIGURATION_BEEP = 1,
38 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
39 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
40 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
41 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
42 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
43 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
44 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
45 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
46}
47impl ActuatorConfiguration {
48 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
49}
50impl Default for ActuatorConfiguration {
51 fn default() -> Self {
52 Self::DEFAULT
53 }
54}
55#[cfg_attr(feature = "ts", derive(TS))]
56#[cfg_attr(feature = "ts", ts(export))]
57#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
58#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
59#[cfg_attr(feature = "serde", serde(tag = "type"))]
60#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
61#[repr(u32)]
62#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
63pub enum ActuatorOutputFunction {
64 #[doc = "No function (disabled)."]
65 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
66 #[doc = "Motor 1"]
67 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
68 #[doc = "Motor 2"]
69 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
70 #[doc = "Motor 3"]
71 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
72 #[doc = "Motor 4"]
73 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
74 #[doc = "Motor 5"]
75 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
76 #[doc = "Motor 6"]
77 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
78 #[doc = "Motor 7"]
79 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
80 #[doc = "Motor 8"]
81 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
82 #[doc = "Motor 9"]
83 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
84 #[doc = "Motor 10"]
85 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
86 #[doc = "Motor 11"]
87 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
88 #[doc = "Motor 12"]
89 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
90 #[doc = "Motor 13"]
91 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
92 #[doc = "Motor 14"]
93 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
94 #[doc = "Motor 15"]
95 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
96 #[doc = "Motor 16"]
97 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
98 #[doc = "Servo 1"]
99 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
100 #[doc = "Servo 2"]
101 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
102 #[doc = "Servo 3"]
103 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
104 #[doc = "Servo 4"]
105 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
106 #[doc = "Servo 5"]
107 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
108 #[doc = "Servo 6"]
109 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
110 #[doc = "Servo 7"]
111 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
112 #[doc = "Servo 8"]
113 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
114 #[doc = "Servo 9"]
115 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
116 #[doc = "Servo 10"]
117 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
118 #[doc = "Servo 11"]
119 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
120 #[doc = "Servo 12"]
121 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
122 #[doc = "Servo 13"]
123 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
124 #[doc = "Servo 14"]
125 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
126 #[doc = "Servo 15"]
127 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
128 #[doc = "Servo 16"]
129 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
130}
131impl ActuatorOutputFunction {
132 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
133}
134impl Default for ActuatorOutputFunction {
135 fn default() -> Self {
136 Self::DEFAULT
137 }
138}
139#[cfg_attr(feature = "ts", derive(TS))]
140#[cfg_attr(feature = "ts", ts(export))]
141#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
143#[cfg_attr(feature = "serde", serde(tag = "type"))]
144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
145#[repr(u32)]
146#[doc = "Enumeration of the ADSB altimeter types"]
147pub enum AdsbAltitudeType {
148 #[doc = "Altitude reported from a Baro source using QNH reference"]
149 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
150 #[doc = "Altitude reported from a GNSS source"]
151 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
152}
153impl AdsbAltitudeType {
154 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
155}
156impl Default for AdsbAltitudeType {
157 fn default() -> Self {
158 Self::DEFAULT
159 }
160}
161#[cfg_attr(feature = "ts", derive(TS))]
162#[cfg_attr(feature = "ts", ts(export))]
163#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
164#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
165#[cfg_attr(feature = "serde", serde(tag = "type"))]
166#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
167#[repr(u32)]
168#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
169pub enum AdsbEmitterType {
170 ADSB_EMITTER_TYPE_NO_INFO = 0,
171 ADSB_EMITTER_TYPE_LIGHT = 1,
172 ADSB_EMITTER_TYPE_SMALL = 2,
173 ADSB_EMITTER_TYPE_LARGE = 3,
174 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
175 ADSB_EMITTER_TYPE_HEAVY = 5,
176 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
177 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
178 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
179 ADSB_EMITTER_TYPE_GLIDER = 9,
180 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
181 ADSB_EMITTER_TYPE_PARACHUTE = 11,
182 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
183 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
184 ADSB_EMITTER_TYPE_UAV = 14,
185 ADSB_EMITTER_TYPE_SPACE = 15,
186 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
187 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
188 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
189 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
190}
191impl AdsbEmitterType {
192 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
193}
194impl Default for AdsbEmitterType {
195 fn default() -> Self {
196 Self::DEFAULT
197 }
198}
199bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
200impl AdsbFlags {
201 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
202}
203impl Default for AdsbFlags {
204 fn default() -> Self {
205 Self::DEFAULT
206 }
207}
208bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
209impl AisFlags {
210 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
211}
212impl Default for AisFlags {
213 fn default() -> Self {
214 Self::DEFAULT
215 }
216}
217#[cfg_attr(feature = "ts", derive(TS))]
218#[cfg_attr(feature = "ts", ts(export))]
219#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
220#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
221#[cfg_attr(feature = "serde", serde(tag = "type"))]
222#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
223#[repr(u32)]
224#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
225pub enum AisNavStatus {
226 #[doc = "Under way using engine."]
227 UNDER_WAY = 0,
228 AIS_NAV_ANCHORED = 1,
229 AIS_NAV_UN_COMMANDED = 2,
230 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
231 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
232 AIS_NAV_MOORED = 5,
233 AIS_NAV_AGROUND = 6,
234 AIS_NAV_FISHING = 7,
235 AIS_NAV_SAILING = 8,
236 AIS_NAV_RESERVED_HSC = 9,
237 AIS_NAV_RESERVED_WIG = 10,
238 AIS_NAV_RESERVED_1 = 11,
239 AIS_NAV_RESERVED_2 = 12,
240 AIS_NAV_RESERVED_3 = 13,
241 #[doc = "Search And Rescue Transponder."]
242 AIS_NAV_AIS_SART = 14,
243 #[doc = "Not available (default)."]
244 AIS_NAV_UNKNOWN = 15,
245}
246impl AisNavStatus {
247 pub const DEFAULT: Self = Self::UNDER_WAY;
248}
249impl Default for AisNavStatus {
250 fn default() -> Self {
251 Self::DEFAULT
252 }
253}
254#[cfg_attr(feature = "ts", derive(TS))]
255#[cfg_attr(feature = "ts", ts(export))]
256#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
257#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
258#[cfg_attr(feature = "serde", serde(tag = "type"))]
259#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
260#[repr(u32)]
261#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
262pub enum AisType {
263 #[doc = "Not available (default)."]
264 AIS_TYPE_UNKNOWN = 0,
265 AIS_TYPE_RESERVED_1 = 1,
266 AIS_TYPE_RESERVED_2 = 2,
267 AIS_TYPE_RESERVED_3 = 3,
268 AIS_TYPE_RESERVED_4 = 4,
269 AIS_TYPE_RESERVED_5 = 5,
270 AIS_TYPE_RESERVED_6 = 6,
271 AIS_TYPE_RESERVED_7 = 7,
272 AIS_TYPE_RESERVED_8 = 8,
273 AIS_TYPE_RESERVED_9 = 9,
274 AIS_TYPE_RESERVED_10 = 10,
275 AIS_TYPE_RESERVED_11 = 11,
276 AIS_TYPE_RESERVED_12 = 12,
277 AIS_TYPE_RESERVED_13 = 13,
278 AIS_TYPE_RESERVED_14 = 14,
279 AIS_TYPE_RESERVED_15 = 15,
280 AIS_TYPE_RESERVED_16 = 16,
281 AIS_TYPE_RESERVED_17 = 17,
282 AIS_TYPE_RESERVED_18 = 18,
283 AIS_TYPE_RESERVED_19 = 19,
284 #[doc = "Wing In Ground effect."]
285 AIS_TYPE_WIG = 20,
286 AIS_TYPE_WIG_HAZARDOUS_A = 21,
287 AIS_TYPE_WIG_HAZARDOUS_B = 22,
288 AIS_TYPE_WIG_HAZARDOUS_C = 23,
289 AIS_TYPE_WIG_HAZARDOUS_D = 24,
290 AIS_TYPE_WIG_RESERVED_1 = 25,
291 AIS_TYPE_WIG_RESERVED_2 = 26,
292 AIS_TYPE_WIG_RESERVED_3 = 27,
293 AIS_TYPE_WIG_RESERVED_4 = 28,
294 AIS_TYPE_WIG_RESERVED_5 = 29,
295 AIS_TYPE_FISHING = 30,
296 AIS_TYPE_TOWING = 31,
297 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
298 AIS_TYPE_TOWING_LARGE = 32,
299 #[doc = "Dredging or other underwater ops."]
300 AIS_TYPE_DREDGING = 33,
301 AIS_TYPE_DIVING = 34,
302 AIS_TYPE_MILITARY = 35,
303 AIS_TYPE_SAILING = 36,
304 AIS_TYPE_PLEASURE = 37,
305 AIS_TYPE_RESERVED_20 = 38,
306 AIS_TYPE_RESERVED_21 = 39,
307 #[doc = "High Speed Craft."]
308 AIS_TYPE_HSC = 40,
309 AIS_TYPE_HSC_HAZARDOUS_A = 41,
310 AIS_TYPE_HSC_HAZARDOUS_B = 42,
311 AIS_TYPE_HSC_HAZARDOUS_C = 43,
312 AIS_TYPE_HSC_HAZARDOUS_D = 44,
313 AIS_TYPE_HSC_RESERVED_1 = 45,
314 AIS_TYPE_HSC_RESERVED_2 = 46,
315 AIS_TYPE_HSC_RESERVED_3 = 47,
316 AIS_TYPE_HSC_RESERVED_4 = 48,
317 AIS_TYPE_HSC_UNKNOWN = 49,
318 AIS_TYPE_PILOT = 50,
319 #[doc = "Search And Rescue vessel."]
320 AIS_TYPE_SAR = 51,
321 AIS_TYPE_TUG = 52,
322 AIS_TYPE_PORT_TENDER = 53,
323 #[doc = "Anti-pollution equipment."]
324 AIS_TYPE_ANTI_POLLUTION = 54,
325 AIS_TYPE_LAW_ENFORCEMENT = 55,
326 AIS_TYPE_SPARE_LOCAL_1 = 56,
327 AIS_TYPE_SPARE_LOCAL_2 = 57,
328 AIS_TYPE_MEDICAL_TRANSPORT = 58,
329 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
330 AIS_TYPE_NONECOMBATANT = 59,
331 AIS_TYPE_PASSENGER = 60,
332 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
333 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
334 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
335 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
336 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
337 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
338 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
339 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
340 AIS_TYPE_PASSENGER_UNKNOWN = 69,
341 AIS_TYPE_CARGO = 70,
342 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
343 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
344 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
345 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
346 AIS_TYPE_CARGO_RESERVED_1 = 75,
347 AIS_TYPE_CARGO_RESERVED_2 = 76,
348 AIS_TYPE_CARGO_RESERVED_3 = 77,
349 AIS_TYPE_CARGO_RESERVED_4 = 78,
350 AIS_TYPE_CARGO_UNKNOWN = 79,
351 AIS_TYPE_TANKER = 80,
352 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
353 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
354 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
355 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
356 AIS_TYPE_TANKER_RESERVED_1 = 85,
357 AIS_TYPE_TANKER_RESERVED_2 = 86,
358 AIS_TYPE_TANKER_RESERVED_3 = 87,
359 AIS_TYPE_TANKER_RESERVED_4 = 88,
360 AIS_TYPE_TANKER_UNKNOWN = 89,
361 AIS_TYPE_OTHER = 90,
362 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
363 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
364 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
365 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
366 AIS_TYPE_OTHER_RESERVED_1 = 95,
367 AIS_TYPE_OTHER_RESERVED_2 = 96,
368 AIS_TYPE_OTHER_RESERVED_3 = 97,
369 AIS_TYPE_OTHER_RESERVED_4 = 98,
370 AIS_TYPE_OTHER_UNKNOWN = 99,
371}
372impl AisType {
373 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
374}
375impl Default for AisType {
376 fn default() -> Self {
377 Self::DEFAULT
378 }
379}
380bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
381impl AttitudeTargetTypemask {
382 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
383}
384impl Default for AttitudeTargetTypemask {
385 fn default() -> Self {
386 Self::DEFAULT
387 }
388}
389#[cfg_attr(feature = "ts", derive(TS))]
390#[cfg_attr(feature = "ts", ts(export))]
391#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
392#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
393#[cfg_attr(feature = "serde", serde(tag = "type"))]
394#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
395#[repr(u32)]
396#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
397pub enum AutotuneAxis {
398 #[doc = "Autotune roll axis."]
399 AUTOTUNE_AXIS_ROLL = 1,
400 #[doc = "Autotune pitch axis."]
401 AUTOTUNE_AXIS_PITCH = 2,
402 #[doc = "Autotune yaw axis."]
403 AUTOTUNE_AXIS_YAW = 4,
404}
405impl AutotuneAxis {
406 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
407}
408impl Default for AutotuneAxis {
409 fn default() -> Self {
410 Self::DEFAULT
411 }
412}
413bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
414impl CameraCapFlags {
415 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
416}
417impl Default for CameraCapFlags {
418 fn default() -> Self {
419 Self::DEFAULT
420 }
421}
422#[cfg_attr(feature = "ts", derive(TS))]
423#[cfg_attr(feature = "ts", ts(export))]
424#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
425#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
426#[cfg_attr(feature = "serde", serde(tag = "type"))]
427#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
428#[repr(u32)]
429#[doc = "Camera Modes."]
430pub enum CameraMode {
431 #[doc = "Camera is in image/photo capture mode."]
432 CAMERA_MODE_IMAGE = 0,
433 #[doc = "Camera is in video capture mode."]
434 CAMERA_MODE_VIDEO = 1,
435 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
436 CAMERA_MODE_IMAGE_SURVEY = 2,
437}
438impl CameraMode {
439 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
440}
441impl Default for CameraMode {
442 fn default() -> Self {
443 Self::DEFAULT
444 }
445}
446#[cfg_attr(feature = "ts", derive(TS))]
447#[cfg_attr(feature = "ts", ts(export))]
448#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
449#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
450#[cfg_attr(feature = "serde", serde(tag = "type"))]
451#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
452#[repr(u32)]
453#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
454pub enum CameraSource {
455 #[doc = "Default camera source."]
456 CAMERA_SOURCE_DEFAULT = 0,
457 #[doc = "RGB camera source."]
458 CAMERA_SOURCE_RGB = 1,
459 #[doc = "IR camera source."]
460 CAMERA_SOURCE_IR = 2,
461 #[doc = "NDVI camera source."]
462 CAMERA_SOURCE_NDVI = 3,
463}
464impl CameraSource {
465 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
466}
467impl Default for CameraSource {
468 fn default() -> Self {
469 Self::DEFAULT
470 }
471}
472#[cfg_attr(feature = "ts", derive(TS))]
473#[cfg_attr(feature = "ts", ts(export))]
474#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
475#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
476#[cfg_attr(feature = "serde", serde(tag = "type"))]
477#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
478#[repr(u32)]
479#[doc = "Camera tracking modes"]
480pub enum CameraTrackingMode {
481 #[doc = "Not tracking"]
482 CAMERA_TRACKING_MODE_NONE = 0,
483 #[doc = "Target is a point"]
484 CAMERA_TRACKING_MODE_POINT = 1,
485 #[doc = "Target is a rectangle"]
486 CAMERA_TRACKING_MODE_RECTANGLE = 2,
487}
488impl CameraTrackingMode {
489 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
490}
491impl Default for CameraTrackingMode {
492 fn default() -> Self {
493 Self::DEFAULT
494 }
495}
496#[cfg_attr(feature = "ts", derive(TS))]
497#[cfg_attr(feature = "ts", ts(export))]
498#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
499#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
500#[cfg_attr(feature = "serde", serde(tag = "type"))]
501#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
502#[repr(u32)]
503#[doc = "Camera tracking status flags"]
504pub enum CameraTrackingStatusFlags {
505 #[doc = "Camera is not tracking"]
506 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
507 #[doc = "Camera is tracking"]
508 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
509 #[doc = "Camera tracking in error state"]
510 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
511}
512impl CameraTrackingStatusFlags {
513 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
514}
515impl Default for CameraTrackingStatusFlags {
516 fn default() -> Self {
517 Self::DEFAULT
518 }
519}
520bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
521impl CameraTrackingTargetData {
522 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
523}
524impl Default for CameraTrackingTargetData {
525 fn default() -> Self {
526 Self::DEFAULT
527 }
528}
529#[cfg_attr(feature = "ts", derive(TS))]
530#[cfg_attr(feature = "ts", ts(export))]
531#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
532#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
533#[cfg_attr(feature = "serde", serde(tag = "type"))]
534#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
535#[repr(u32)]
536#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
537pub enum CameraZoomType {
538 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
539 ZOOM_TYPE_STEP = 0,
540 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
541 ZOOM_TYPE_CONTINUOUS = 1,
542 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
543 ZOOM_TYPE_RANGE = 2,
544 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
545 ZOOM_TYPE_FOCAL_LENGTH = 3,
546 #[doc = "Zoom value as horizontal field of view in degrees."]
547 ZOOM_TYPE_HORIZONTAL_FOV = 4,
548}
549impl CameraZoomType {
550 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
551}
552impl Default for CameraZoomType {
553 fn default() -> Self {
554 Self::DEFAULT
555 }
556}
557#[cfg_attr(feature = "ts", derive(TS))]
558#[cfg_attr(feature = "ts", ts(export))]
559#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
560#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
561#[cfg_attr(feature = "serde", serde(tag = "type"))]
562#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
563#[repr(u32)]
564pub enum CanFilterOp {
565 CAN_FILTER_REPLACE = 0,
566 CAN_FILTER_ADD = 1,
567 CAN_FILTER_REMOVE = 2,
568}
569impl CanFilterOp {
570 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
571}
572impl Default for CanFilterOp {
573 fn default() -> Self {
574 Self::DEFAULT
575 }
576}
577#[cfg_attr(feature = "ts", derive(TS))]
578#[cfg_attr(feature = "ts", ts(export))]
579#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
580#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
581#[cfg_attr(feature = "serde", serde(tag = "type"))]
582#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
583#[repr(u32)]
584#[doc = "Possible responses from a CELLULAR_CONFIG message."]
585pub enum CellularConfigResponse {
586 #[doc = "Changes accepted."]
587 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
588 #[doc = "Invalid APN."]
589 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
590 #[doc = "Invalid PIN."]
591 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
592 #[doc = "Changes rejected."]
593 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
594 #[doc = "PUK is required to unblock SIM card."]
595 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
596}
597impl CellularConfigResponse {
598 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
599}
600impl Default for CellularConfigResponse {
601 fn default() -> Self {
602 Self::DEFAULT
603 }
604}
605#[cfg_attr(feature = "ts", derive(TS))]
606#[cfg_attr(feature = "ts", ts(export))]
607#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
608#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
609#[cfg_attr(feature = "serde", serde(tag = "type"))]
610#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
611#[repr(u32)]
612#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
613pub enum CellularNetworkFailedReason {
614 #[doc = "No error"]
615 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
616 #[doc = "Error state is unknown"]
617 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
618 #[doc = "SIM is required for the modem but missing"]
619 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
620 #[doc = "SIM is available, but not usable for connection"]
621 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
622}
623impl CellularNetworkFailedReason {
624 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
625}
626impl Default for CellularNetworkFailedReason {
627 fn default() -> Self {
628 Self::DEFAULT
629 }
630}
631#[cfg_attr(feature = "ts", derive(TS))]
632#[cfg_attr(feature = "ts", ts(export))]
633#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
634#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
635#[cfg_attr(feature = "serde", serde(tag = "type"))]
636#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
637#[repr(u32)]
638#[doc = "Cellular network radio type"]
639pub enum CellularNetworkRadioType {
640 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
641 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
642 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
643 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
644 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
645}
646impl CellularNetworkRadioType {
647 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
648}
649impl Default for CellularNetworkRadioType {
650 fn default() -> Self {
651 Self::DEFAULT
652 }
653}
654#[cfg_attr(feature = "ts", derive(TS))]
655#[cfg_attr(feature = "ts", ts(export))]
656#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
657#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
658#[cfg_attr(feature = "serde", serde(tag = "type"))]
659#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
660#[repr(u32)]
661#[doc = "These flags encode the cellular network status"]
662pub enum CellularStatusFlag {
663 #[doc = "State unknown or not reportable."]
664 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
665 #[doc = "Modem is unusable"]
666 CELLULAR_STATUS_FLAG_FAILED = 1,
667 #[doc = "Modem is being initialized"]
668 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
669 #[doc = "Modem is locked"]
670 CELLULAR_STATUS_FLAG_LOCKED = 3,
671 #[doc = "Modem is not enabled and is powered down"]
672 CELLULAR_STATUS_FLAG_DISABLED = 4,
673 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
674 CELLULAR_STATUS_FLAG_DISABLING = 5,
675 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
676 CELLULAR_STATUS_FLAG_ENABLING = 6,
677 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
678 CELLULAR_STATUS_FLAG_ENABLED = 7,
679 #[doc = "Modem is searching for a network provider to register"]
680 CELLULAR_STATUS_FLAG_SEARCHING = 8,
681 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
682 CELLULAR_STATUS_FLAG_REGISTERED = 9,
683 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
684 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
685 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
686 CELLULAR_STATUS_FLAG_CONNECTING = 11,
687 #[doc = "One or more packet data bearers is active and connected"]
688 CELLULAR_STATUS_FLAG_CONNECTED = 12,
689}
690impl CellularStatusFlag {
691 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
692}
693impl Default for CellularStatusFlag {
694 fn default() -> Self {
695 Self::DEFAULT
696 }
697}
698#[cfg_attr(feature = "ts", derive(TS))]
699#[cfg_attr(feature = "ts", ts(export))]
700#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
701#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
702#[cfg_attr(feature = "serde", serde(tag = "type"))]
703#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
704#[repr(u32)]
705#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
706pub enum CompMetadataType {
707 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
708 COMP_METADATA_TYPE_GENERAL = 0,
709 #[doc = "Parameter meta data."]
710 COMP_METADATA_TYPE_PARAMETER = 1,
711 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
712 COMP_METADATA_TYPE_COMMANDS = 2,
713 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
714 COMP_METADATA_TYPE_PERIPHERALS = 3,
715 #[doc = "Meta data for the events interface."]
716 COMP_METADATA_TYPE_EVENTS = 4,
717 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
718 COMP_METADATA_TYPE_ACTUATORS = 5,
719}
720impl CompMetadataType {
721 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
722}
723impl Default for CompMetadataType {
724 fn default() -> Self {
725 Self::DEFAULT
726 }
727}
728#[cfg_attr(feature = "ts", derive(TS))]
729#[cfg_attr(feature = "ts", ts(export))]
730#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
731#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
732#[cfg_attr(feature = "serde", serde(tag = "type"))]
733#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
734#[repr(u32)]
735#[doc = "Indicates the ESC connection type."]
736pub enum EscConnectionType {
737 #[doc = "Traditional PPM ESC."]
738 ESC_CONNECTION_TYPE_PPM = 0,
739 #[doc = "Serial Bus connected ESC."]
740 ESC_CONNECTION_TYPE_SERIAL = 1,
741 #[doc = "One Shot PPM ESC."]
742 ESC_CONNECTION_TYPE_ONESHOT = 2,
743 #[doc = "I2C ESC."]
744 ESC_CONNECTION_TYPE_I2C = 3,
745 #[doc = "CAN-Bus ESC."]
746 ESC_CONNECTION_TYPE_CAN = 4,
747 #[doc = "DShot ESC."]
748 ESC_CONNECTION_TYPE_DSHOT = 5,
749}
750impl EscConnectionType {
751 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
752}
753impl Default for EscConnectionType {
754 fn default() -> Self {
755 Self::DEFAULT
756 }
757}
758bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
759impl EscFailureFlags {
760 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
761}
762impl Default for EscFailureFlags {
763 fn default() -> Self {
764 Self::DEFAULT
765 }
766}
767bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
768impl EstimatorStatusFlags {
769 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
770}
771impl Default for EstimatorStatusFlags {
772 fn default() -> Self {
773 Self::DEFAULT
774 }
775}
776#[cfg_attr(feature = "ts", derive(TS))]
777#[cfg_attr(feature = "ts", ts(export))]
778#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
779#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
780#[cfg_attr(feature = "serde", serde(tag = "type"))]
781#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
782#[repr(u32)]
783#[doc = "List of possible failure type to inject."]
784pub enum FailureType {
785 #[doc = "No failure injected, used to reset a previous failure."]
786 FAILURE_TYPE_OK = 0,
787 #[doc = "Sets unit off, so completely non-responsive."]
788 FAILURE_TYPE_OFF = 1,
789 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
790 FAILURE_TYPE_STUCK = 2,
791 #[doc = "Unit is reporting complete garbage."]
792 FAILURE_TYPE_GARBAGE = 3,
793 #[doc = "Unit is consistently wrong."]
794 FAILURE_TYPE_WRONG = 4,
795 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
796 FAILURE_TYPE_SLOW = 5,
797 #[doc = "Data of unit is delayed in time."]
798 FAILURE_TYPE_DELAYED = 6,
799 #[doc = "Unit is sometimes working, sometimes not."]
800 FAILURE_TYPE_INTERMITTENT = 7,
801}
802impl FailureType {
803 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
804}
805impl Default for FailureType {
806 fn default() -> Self {
807 Self::DEFAULT
808 }
809}
810#[cfg_attr(feature = "ts", derive(TS))]
811#[cfg_attr(feature = "ts", ts(export))]
812#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
813#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
814#[cfg_attr(feature = "serde", serde(tag = "type"))]
815#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
816#[repr(u32)]
817#[doc = "List of possible units where failures can be injected."]
818pub enum FailureUnit {
819 FAILURE_UNIT_SENSOR_GYRO = 0,
820 FAILURE_UNIT_SENSOR_ACCEL = 1,
821 FAILURE_UNIT_SENSOR_MAG = 2,
822 FAILURE_UNIT_SENSOR_BARO = 3,
823 FAILURE_UNIT_SENSOR_GPS = 4,
824 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
825 FAILURE_UNIT_SENSOR_VIO = 6,
826 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
827 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
828 FAILURE_UNIT_SYSTEM_BATTERY = 100,
829 FAILURE_UNIT_SYSTEM_MOTOR = 101,
830 FAILURE_UNIT_SYSTEM_SERVO = 102,
831 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
832 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
833 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
834}
835impl FailureUnit {
836 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
837}
838impl Default for FailureUnit {
839 fn default() -> Self {
840 Self::DEFAULT
841 }
842}
843#[cfg_attr(feature = "ts", derive(TS))]
844#[cfg_attr(feature = "ts", ts(export))]
845#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
846#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
847#[cfg_attr(feature = "serde", serde(tag = "type"))]
848#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
849#[repr(u32)]
850pub enum FenceBreach {
851 #[doc = "No last fence breach"]
852 FENCE_BREACH_NONE = 0,
853 #[doc = "Breached minimum altitude"]
854 FENCE_BREACH_MINALT = 1,
855 #[doc = "Breached maximum altitude"]
856 FENCE_BREACH_MAXALT = 2,
857 #[doc = "Breached fence boundary"]
858 FENCE_BREACH_BOUNDARY = 3,
859}
860impl FenceBreach {
861 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
862}
863impl Default for FenceBreach {
864 fn default() -> Self {
865 Self::DEFAULT
866 }
867}
868#[cfg_attr(feature = "ts", derive(TS))]
869#[cfg_attr(feature = "ts", ts(export))]
870#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
871#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
872#[cfg_attr(feature = "serde", serde(tag = "type"))]
873#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
874#[repr(u32)]
875#[doc = "Actions being taken to mitigate/prevent fence breach"]
876pub enum FenceMitigate {
877 #[doc = "Unknown"]
878 FENCE_MITIGATE_UNKNOWN = 0,
879 #[doc = "No actions being taken"]
880 FENCE_MITIGATE_NONE = 1,
881 #[doc = "Velocity limiting active to prevent breach"]
882 FENCE_MITIGATE_VEL_LIMIT = 2,
883}
884impl FenceMitigate {
885 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
886}
887impl Default for FenceMitigate {
888 fn default() -> Self {
889 Self::DEFAULT
890 }
891}
892#[cfg_attr(feature = "ts", derive(TS))]
893#[cfg_attr(feature = "ts", ts(export))]
894#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
895#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
896#[cfg_attr(feature = "serde", serde(tag = "type"))]
897#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
898#[repr(u32)]
899#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
900pub enum FenceType {
901 #[doc = "Maximum altitude fence"]
902 FENCE_TYPE_ALT_MAX = 1,
903 #[doc = "Circle fence"]
904 FENCE_TYPE_CIRCLE = 2,
905 #[doc = "Polygon fence"]
906 FENCE_TYPE_POLYGON = 4,
907 #[doc = "Minimum altitude fence"]
908 FENCE_TYPE_ALT_MIN = 8,
909}
910impl FenceType {
911 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
912}
913impl Default for FenceType {
914 fn default() -> Self {
915 Self::DEFAULT
916 }
917}
918#[cfg_attr(feature = "ts", derive(TS))]
919#[cfg_attr(feature = "ts", ts(export))]
920#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
921#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
922#[cfg_attr(feature = "serde", serde(tag = "type"))]
923#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
924#[repr(u32)]
925#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
926pub enum FirmwareVersionType {
927 #[doc = "development release"]
928 FIRMWARE_VERSION_TYPE_DEV = 0,
929 #[doc = "alpha release"]
930 FIRMWARE_VERSION_TYPE_ALPHA = 64,
931 #[doc = "beta release"]
932 FIRMWARE_VERSION_TYPE_BETA = 128,
933 #[doc = "release candidate"]
934 FIRMWARE_VERSION_TYPE_RC = 192,
935 #[doc = "official stable release"]
936 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
937}
938impl FirmwareVersionType {
939 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
940}
941impl Default for FirmwareVersionType {
942 fn default() -> Self {
943 Self::DEFAULT
944 }
945}
946bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
947impl GimbalDeviceCapFlags {
948 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
949}
950impl Default for GimbalDeviceCapFlags {
951 fn default() -> Self {
952 Self::DEFAULT
953 }
954}
955bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
956impl GimbalDeviceErrorFlags {
957 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
958}
959impl Default for GimbalDeviceErrorFlags {
960 fn default() -> Self {
961 Self::DEFAULT
962 }
963}
964bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
965impl GimbalDeviceFlags {
966 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
967}
968impl Default for GimbalDeviceFlags {
969 fn default() -> Self {
970 Self::DEFAULT
971 }
972}
973bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
974impl GimbalManagerCapFlags {
975 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
976}
977impl Default for GimbalManagerCapFlags {
978 fn default() -> Self {
979 Self::DEFAULT
980 }
981}
982bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
983impl GimbalManagerFlags {
984 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
985}
986impl Default for GimbalManagerFlags {
987 fn default() -> Self {
988 Self::DEFAULT
989 }
990}
991#[cfg_attr(feature = "ts", derive(TS))]
992#[cfg_attr(feature = "ts", ts(export))]
993#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
994#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
995#[cfg_attr(feature = "serde", serde(tag = "type"))]
996#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
997#[repr(u32)]
998#[doc = "Type of GPS fix"]
999pub enum GpsFixType {
1000 #[doc = "No GPS connected"]
1001 GPS_FIX_TYPE_NO_GPS = 0,
1002 #[doc = "No position information, GPS is connected"]
1003 GPS_FIX_TYPE_NO_FIX = 1,
1004 #[doc = "2D position"]
1005 GPS_FIX_TYPE_2D_FIX = 2,
1006 #[doc = "3D position"]
1007 GPS_FIX_TYPE_3D_FIX = 3,
1008 #[doc = "DGPS/SBAS aided 3D position"]
1009 GPS_FIX_TYPE_DGPS = 4,
1010 #[doc = "RTK float, 3D position"]
1011 GPS_FIX_TYPE_RTK_FLOAT = 5,
1012 #[doc = "RTK Fixed, 3D position"]
1013 GPS_FIX_TYPE_RTK_FIXED = 6,
1014 #[doc = "Static fixed, typically used for base stations"]
1015 GPS_FIX_TYPE_STATIC = 7,
1016 #[doc = "PPP, 3D position."]
1017 GPS_FIX_TYPE_PPP = 8,
1018}
1019impl GpsFixType {
1020 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1021}
1022impl Default for GpsFixType {
1023 fn default() -> Self {
1024 Self::DEFAULT
1025 }
1026}
1027bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
1028impl GpsInputIgnoreFlags {
1029 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
1030}
1031impl Default for GpsInputIgnoreFlags {
1032 fn default() -> Self {
1033 Self::DEFAULT
1034 }
1035}
1036#[cfg_attr(feature = "ts", derive(TS))]
1037#[cfg_attr(feature = "ts", ts(export))]
1038#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1039#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1040#[cfg_attr(feature = "serde", serde(tag = "type"))]
1041#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1042#[repr(u32)]
1043#[doc = "Gripper actions."]
1044pub enum GripperActions {
1045 #[doc = "Gripper release cargo."]
1046 GRIPPER_ACTION_RELEASE = 0,
1047 #[doc = "Gripper grab onto cargo."]
1048 GRIPPER_ACTION_GRAB = 1,
1049}
1050impl GripperActions {
1051 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1052}
1053impl Default for GripperActions {
1054 fn default() -> Self {
1055 Self::DEFAULT
1056 }
1057}
1058bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1059impl HighresImuUpdatedFlags {
1060 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1061}
1062impl Default for HighresImuUpdatedFlags {
1063 fn default() -> Self {
1064 Self::DEFAULT
1065 }
1066}
1067bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1068impl HilActuatorControlsFlags {
1069 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1070}
1071impl Default for HilActuatorControlsFlags {
1072 fn default() -> Self {
1073 Self::DEFAULT
1074 }
1075}
1076bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1077impl HilSensorUpdatedFlags {
1078 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1079}
1080impl Default for HilSensorUpdatedFlags {
1081 fn default() -> Self {
1082 Self::DEFAULT
1083 }
1084}
1085bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1086impl HlFailureFlag {
1087 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1088}
1089impl Default for HlFailureFlag {
1090 fn default() -> Self {
1091 Self::DEFAULT
1092 }
1093}
1094bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1095impl IlluminatorErrorFlags {
1096 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1097}
1098impl Default for IlluminatorErrorFlags {
1099 fn default() -> Self {
1100 Self::DEFAULT
1101 }
1102}
1103#[cfg_attr(feature = "ts", derive(TS))]
1104#[cfg_attr(feature = "ts", ts(export))]
1105#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1106#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1107#[cfg_attr(feature = "serde", serde(tag = "type"))]
1108#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1109#[repr(u32)]
1110#[doc = "Modes of illuminator"]
1111pub enum IlluminatorMode {
1112 #[doc = "Illuminator mode is not specified/unknown"]
1113 ILLUMINATOR_MODE_UNKNOWN = 0,
1114 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1115 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1116 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1117 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1118}
1119impl IlluminatorMode {
1120 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1121}
1122impl Default for IlluminatorMode {
1123 fn default() -> Self {
1124 Self::DEFAULT
1125 }
1126}
1127#[cfg_attr(feature = "ts", derive(TS))]
1128#[cfg_attr(feature = "ts", ts(export))]
1129#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1131#[cfg_attr(feature = "serde", serde(tag = "type"))]
1132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1133#[repr(u32)]
1134#[doc = "Type of landing target"]
1135pub enum LandingTargetType {
1136 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1137 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1138 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1139 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1140 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1141 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1142 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1143 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1144}
1145impl LandingTargetType {
1146 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1147}
1148impl Default for LandingTargetType {
1149 fn default() -> Self {
1150 Self::DEFAULT
1151 }
1152}
1153#[cfg_attr(feature = "ts", derive(TS))]
1154#[cfg_attr(feature = "ts", ts(export))]
1155#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1156#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1157#[cfg_attr(feature = "serde", serde(tag = "type"))]
1158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1159#[repr(u32)]
1160pub enum MagCalStatus {
1161 MAG_CAL_NOT_STARTED = 0,
1162 MAG_CAL_WAITING_TO_START = 1,
1163 MAG_CAL_RUNNING_STEP_ONE = 2,
1164 MAG_CAL_RUNNING_STEP_TWO = 3,
1165 MAG_CAL_SUCCESS = 4,
1166 MAG_CAL_FAILED = 5,
1167 MAG_CAL_BAD_ORIENTATION = 6,
1168 MAG_CAL_BAD_RADIUS = 7,
1169}
1170impl MagCalStatus {
1171 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1172}
1173impl Default for MagCalStatus {
1174 fn default() -> Self {
1175 Self::DEFAULT
1176 }
1177}
1178#[cfg_attr(feature = "ts", derive(TS))]
1179#[cfg_attr(feature = "ts", ts(export))]
1180#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1181#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1182#[cfg_attr(feature = "serde", serde(tag = "type"))]
1183#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1184#[repr(u32)]
1185pub enum MavArmAuthDeniedReason {
1186 #[doc = "Not a specific reason"]
1187 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1188 #[doc = "Authorizer will send the error as string to GCS"]
1189 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1190 #[doc = "At least one waypoint have a invalid value"]
1191 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1192 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1193 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1194 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1195 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1196 #[doc = "Weather is not good to fly"]
1197 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1198}
1199impl MavArmAuthDeniedReason {
1200 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1201}
1202impl Default for MavArmAuthDeniedReason {
1203 fn default() -> Self {
1204 Self::DEFAULT
1205 }
1206}
1207#[cfg_attr(feature = "ts", derive(TS))]
1208#[cfg_attr(feature = "ts", ts(export))]
1209#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1210#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1211#[cfg_attr(feature = "serde", serde(tag = "type"))]
1212#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1213#[repr(u32)]
1214#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1215pub enum MavAutopilot {
1216 #[doc = "Generic autopilot, full support for everything"]
1217 MAV_AUTOPILOT_GENERIC = 0,
1218 #[doc = "Reserved for future use."]
1219 MAV_AUTOPILOT_RESERVED = 1,
1220 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1221 MAV_AUTOPILOT_SLUGS = 2,
1222 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1223 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1224 #[doc = "OpenPilot, <http://openpilot.org>"]
1225 MAV_AUTOPILOT_OPENPILOT = 4,
1226 #[doc = "Generic autopilot only supporting simple waypoints"]
1227 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1228 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1229 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1230 #[doc = "Generic autopilot supporting the full mission command set"]
1231 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1232 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1233 MAV_AUTOPILOT_INVALID = 8,
1234 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1235 MAV_AUTOPILOT_PPZ = 9,
1236 #[doc = "UAV Dev Board"]
1237 MAV_AUTOPILOT_UDB = 10,
1238 #[doc = "FlexiPilot"]
1239 MAV_AUTOPILOT_FP = 11,
1240 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1241 MAV_AUTOPILOT_PX4 = 12,
1242 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1243 MAV_AUTOPILOT_SMACCMPILOT = 13,
1244 #[doc = "AutoQuad -- <http://autoquad.org>"]
1245 MAV_AUTOPILOT_AUTOQUAD = 14,
1246 #[doc = "Armazila -- <http://armazila.com>"]
1247 MAV_AUTOPILOT_ARMAZILA = 15,
1248 #[doc = "Aerob -- <http://aerob.ru>"]
1249 MAV_AUTOPILOT_AEROB = 16,
1250 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1251 MAV_AUTOPILOT_ASLUAV = 17,
1252 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1253 MAV_AUTOPILOT_SMARTAP = 18,
1254 #[doc = "AirRails - <http://uaventure.com>"]
1255 MAV_AUTOPILOT_AIRRAILS = 19,
1256 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1257 MAV_AUTOPILOT_REFLEX = 20,
1258}
1259impl MavAutopilot {
1260 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1261}
1262impl Default for MavAutopilot {
1263 fn default() -> Self {
1264 Self::DEFAULT
1265 }
1266}
1267#[cfg_attr(feature = "ts", derive(TS))]
1268#[cfg_attr(feature = "ts", ts(export))]
1269#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1270#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1271#[cfg_attr(feature = "serde", serde(tag = "type"))]
1272#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1273#[repr(u32)]
1274#[doc = "Enumeration for battery charge states."]
1275pub enum MavBatteryChargeState {
1276 #[doc = "Low battery state is not provided"]
1277 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1278 #[doc = "Battery is not in low state. Normal operation."]
1279 MAV_BATTERY_CHARGE_STATE_OK = 1,
1280 #[doc = "Battery state is low, warn and monitor close."]
1281 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1282 #[doc = "Battery state is critical, return or abort immediately."]
1283 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1284 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1285 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1286 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1287 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1288 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1289 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1290 #[doc = "Battery is charging."]
1291 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1292}
1293impl MavBatteryChargeState {
1294 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1295}
1296impl Default for MavBatteryChargeState {
1297 fn default() -> Self {
1298 Self::DEFAULT
1299 }
1300}
1301bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1302impl MavBatteryFault {
1303 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1304}
1305impl Default for MavBatteryFault {
1306 fn default() -> Self {
1307 Self::DEFAULT
1308 }
1309}
1310#[cfg_attr(feature = "ts", derive(TS))]
1311#[cfg_attr(feature = "ts", ts(export))]
1312#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1313#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1314#[cfg_attr(feature = "serde", serde(tag = "type"))]
1315#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1316#[repr(u32)]
1317#[doc = "Enumeration of battery functions"]
1318pub enum MavBatteryFunction {
1319 #[doc = "Battery function is unknown"]
1320 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1321 #[doc = "Battery supports all flight systems"]
1322 MAV_BATTERY_FUNCTION_ALL = 1,
1323 #[doc = "Battery for the propulsion system"]
1324 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1325 #[doc = "Avionics battery"]
1326 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1327 #[doc = "Payload battery"]
1328 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1329}
1330impl MavBatteryFunction {
1331 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1332}
1333impl Default for MavBatteryFunction {
1334 fn default() -> Self {
1335 Self::DEFAULT
1336 }
1337}
1338#[cfg_attr(feature = "ts", derive(TS))]
1339#[cfg_attr(feature = "ts", ts(export))]
1340#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1342#[cfg_attr(feature = "serde", serde(tag = "type"))]
1343#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1344#[repr(u32)]
1345#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1346pub enum MavBatteryMode {
1347 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1348 MAV_BATTERY_MODE_UNKNOWN = 0,
1349 #[doc = "Battery is auto discharging (towards storage level)."]
1350 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1351 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1352 MAV_BATTERY_MODE_HOT_SWAP = 2,
1353}
1354impl MavBatteryMode {
1355 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1356}
1357impl Default for MavBatteryMode {
1358 fn default() -> Self {
1359 Self::DEFAULT
1360 }
1361}
1362#[cfg_attr(feature = "ts", derive(TS))]
1363#[cfg_attr(feature = "ts", ts(export))]
1364#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1366#[cfg_attr(feature = "serde", serde(tag = "type"))]
1367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1368#[repr(u32)]
1369#[doc = "Enumeration of battery types"]
1370pub enum MavBatteryType {
1371 #[doc = "Not specified."]
1372 MAV_BATTERY_TYPE_UNKNOWN = 0,
1373 #[doc = "Lithium polymer battery"]
1374 MAV_BATTERY_TYPE_LIPO = 1,
1375 #[doc = "Lithium-iron-phosphate battery"]
1376 MAV_BATTERY_TYPE_LIFE = 2,
1377 #[doc = "Lithium-ION battery"]
1378 MAV_BATTERY_TYPE_LION = 3,
1379 #[doc = "Nickel metal hydride battery"]
1380 MAV_BATTERY_TYPE_NIMH = 4,
1381}
1382impl MavBatteryType {
1383 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1384}
1385impl Default for MavBatteryType {
1386 fn default() -> Self {
1387 Self::DEFAULT
1388 }
1389}
1390#[cfg_attr(feature = "ts", derive(TS))]
1391#[cfg_attr(feature = "ts", ts(export))]
1392#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1393#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1394#[cfg_attr(feature = "serde", serde(tag = "type"))]
1395#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1396#[repr(u32)]
1397#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1398pub enum MavCmd {
1399 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1400 MAV_CMD_NAV_WAYPOINT = 16,
1401 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1402 MAV_CMD_NAV_LOITER_UNLIM = 17,
1403 #[doc = "Loiter around this waypoint for X turns"]
1404 MAV_CMD_NAV_LOITER_TURNS = 18,
1405 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1406 MAV_CMD_NAV_LOITER_TIME = 19,
1407 #[doc = "Return to launch location"]
1408 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1409 #[doc = "Land at location."]
1410 MAV_CMD_NAV_LAND = 21,
1411 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1412 MAV_CMD_NAV_TAKEOFF = 22,
1413 #[doc = "Land at local position (local frame only)"]
1414 MAV_CMD_NAV_LAND_LOCAL = 23,
1415 #[doc = "Takeoff from local position (local frame only)"]
1416 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1417 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1418 MAV_CMD_NAV_FOLLOW = 25,
1419 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1420 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1421 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1422 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1423 #[doc = "Begin following a target"]
1424 MAV_CMD_DO_FOLLOW = 32,
1425 #[doc = "Reposition the MAV after a follow target command has been sent"]
1426 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1427 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1428 MAV_CMD_DO_ORBIT = 34,
1429 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1430 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1431 MAV_CMD_NAV_ROI = 80,
1432 #[doc = "Control autonomous path planning on the MAV."]
1433 MAV_CMD_NAV_PATHPLANNING = 81,
1434 #[doc = "Navigate to waypoint using a spline path."]
1435 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1436 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1437 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1438 #[doc = "Land using VTOL mode"]
1439 MAV_CMD_NAV_VTOL_LAND = 85,
1440 #[doc = "hand control over to an external controller"]
1441 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1442 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1443 MAV_CMD_NAV_DELAY = 93,
1444 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1445 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1446 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1447 MAV_CMD_NAV_LAST = 95,
1448 #[doc = "Delay mission state machine."]
1449 MAV_CMD_CONDITION_DELAY = 112,
1450 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1451 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1452 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1453 MAV_CMD_CONDITION_DISTANCE = 114,
1454 #[doc = "Reach a certain target angle."]
1455 MAV_CMD_CONDITION_YAW = 115,
1456 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1457 MAV_CMD_CONDITION_LAST = 159,
1458 #[doc = "Set system mode."]
1459 MAV_CMD_DO_SET_MODE = 176,
1460 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1461 MAV_CMD_DO_JUMP = 177,
1462 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1463 MAV_CMD_DO_CHANGE_SPEED = 178,
1464 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1465 MAV_CMD_DO_SET_HOME = 179,
1466 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1467 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1468 MAV_CMD_DO_SET_PARAMETER = 180,
1469 #[doc = "Set a relay to a condition."]
1470 MAV_CMD_DO_SET_RELAY = 181,
1471 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1472 MAV_CMD_DO_REPEAT_RELAY = 182,
1473 #[doc = "Set a servo to a desired PWM value."]
1474 MAV_CMD_DO_SET_SERVO = 183,
1475 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1476 MAV_CMD_DO_REPEAT_SERVO = 184,
1477 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1478 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1479 #[doc = "Change altitude set point."]
1480 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1481 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1482 MAV_CMD_DO_SET_ACTUATOR = 187,
1483 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1484 MAV_CMD_DO_RETURN_PATH_START = 188,
1485 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1486 MAV_CMD_DO_LAND_START = 189,
1487 #[doc = "Mission command to perform a landing from a rally point."]
1488 MAV_CMD_DO_RALLY_LAND = 190,
1489 #[doc = "Mission command to safely abort an autonomous landing."]
1490 MAV_CMD_DO_GO_AROUND = 191,
1491 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1492 MAV_CMD_DO_REPOSITION = 192,
1493 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1494 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1495 #[doc = "Set moving direction to forward or reverse."]
1496 MAV_CMD_DO_SET_REVERSE = 194,
1497 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1498 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1499 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1500 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1501 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1502 MAV_CMD_DO_SET_ROI_NONE = 197,
1503 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1504 MAV_CMD_DO_SET_ROI_SYSID = 198,
1505 #[doc = "Control onboard camera system."]
1506 MAV_CMD_DO_CONTROL_VIDEO = 200,
1507 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1508 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1509 MAV_CMD_DO_SET_ROI = 201,
1510 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1511 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1512 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1513 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1514 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1515 #[doc = "Mission command to configure a camera or antenna mount"]
1516 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1517 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1518 #[doc = "Mission command to control a camera or antenna mount"]
1519 MAV_CMD_DO_MOUNT_CONTROL = 205,
1520 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1521 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1522 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1523 MAV_CMD_DO_FENCE_ENABLE = 207,
1524 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1525 MAV_CMD_DO_PARACHUTE = 208,
1526 #[doc = "Command to perform motor test."]
1527 MAV_CMD_DO_MOTOR_TEST = 209,
1528 #[doc = "Change to/from inverted flight."]
1529 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1530 #[doc = "Mission command to operate a gripper."]
1531 MAV_CMD_DO_GRIPPER = 211,
1532 #[doc = "Enable/disable autotune."]
1533 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1534 #[doc = "Sets a desired vehicle turn angle and speed change."]
1535 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1536 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1537 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1538 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1539 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1540 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1541 #[doc = "set id of master controller"]
1542 MAV_CMD_DO_GUIDED_MASTER = 221,
1543 #[doc = "Set limits for external control"]
1544 MAV_CMD_DO_GUIDED_LIMITS = 222,
1545 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1546 MAV_CMD_DO_ENGINE_CONTROL = 223,
1547 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1548 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1549 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1550 MAV_CMD_DO_LAST = 240,
1551 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1552 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1553 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1554 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1555 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1556 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1557 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1558 MAV_CMD_PREFLIGHT_STORAGE = 245,
1559 #[doc = "Request the reboot or shutdown of system components."]
1560 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1561 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1562 MAV_CMD_OVERRIDE_GOTO = 252,
1563 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1564 MAV_CMD_OBLIQUE_SURVEY = 260,
1565 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1566 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1567 #[doc = "start running a mission"]
1568 MAV_CMD_MISSION_START = 300,
1569 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1570 MAV_CMD_ACTUATOR_TEST = 310,
1571 #[doc = "Actuator configuration command."]
1572 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1573 #[doc = "Arms / Disarms a component"]
1574 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1575 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1576 MAV_CMD_RUN_PREARM_CHECKS = 401,
1577 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1578 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1579 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1580 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1581 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1582 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1583 MAV_CMD_GET_HOME_POSITION = 410,
1584 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1585 MAV_CMD_INJECT_FAILURE = 420,
1586 #[doc = "Starts receiver pairing."]
1587 MAV_CMD_START_RX_PAIR = 500,
1588 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1589 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1590 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1591 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1592 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1593 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1594 MAV_CMD_REQUEST_MESSAGE = 512,
1595 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1596 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1597 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1598 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1599 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1600 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1601 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1602 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1603 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1604 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1605 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1606 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1607 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1608 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1609 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1610 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1611 MAV_CMD_STORAGE_FORMAT = 526,
1612 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1613 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1614 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1615 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1616 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1617 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1618 #[doc = "Reset all camera settings to Factory Default"]
1619 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1620 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1621 MAV_CMD_SET_CAMERA_MODE = 530,
1622 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1623 MAV_CMD_SET_CAMERA_ZOOM = 531,
1624 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1625 MAV_CMD_SET_CAMERA_FOCUS = 532,
1626 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1627 MAV_CMD_SET_STORAGE_USAGE = 533,
1628 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1629 MAV_CMD_SET_CAMERA_SOURCE = 534,
1630 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1631 MAV_CMD_JUMP_TAG = 600,
1632 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1633 MAV_CMD_DO_JUMP_TAG = 601,
1634 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1635 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1636 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1637 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1638 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1639 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1640 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1641 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1642 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1643 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1644 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1645 #[doc = "Enable or disable on-board camera triggering system."]
1646 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1647 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1648 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1649 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1650 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1651 #[doc = "Stops ongoing tracking."]
1652 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1653 #[doc = "Starts video capture (recording)."]
1654 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1655 #[doc = "Stop the current video capture (recording)."]
1656 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1657 #[doc = "Start video streaming"]
1658 MAV_CMD_VIDEO_START_STREAMING = 2502,
1659 #[doc = "Stop the given video stream"]
1660 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1661 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1662 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1663 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1664 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1665 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1666 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1667 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1668 MAV_CMD_LOGGING_START = 2510,
1669 #[doc = "Request to stop streaming log data over MAVLink"]
1670 MAV_CMD_LOGGING_STOP = 2511,
1671 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1672 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1673 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1674 #[doc = "Create a panorama at the current position"]
1675 MAV_CMD_PANORAMA_CREATE = 2800,
1676 #[doc = "Request VTOL transition"]
1677 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1678 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1679 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1680 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1681 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1682 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1683 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1684 #[doc = "Delay mission state machine until gate has been reached."]
1685 MAV_CMD_CONDITION_GATE = 4501,
1686 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1687 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1688 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1689 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1690 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1691 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1692 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1693 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1694 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1695 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1696 #[doc = "Rally point. You can have multiple rally points defined."]
1697 MAV_CMD_NAV_RALLY_POINT = 5100,
1698 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1699 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1700 #[doc = "Change state of safety switch."]
1701 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1702 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1703 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1704 #[deprecated = " (Deprecated since 2021-06)"]
1705 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1706 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1707 #[deprecated = " (Deprecated since 2021-06)"]
1708 #[doc = "Control the payload deployment."]
1709 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1710 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1711 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1712 #[doc = "Command to operate winch."]
1713 MAV_CMD_DO_WINCH = 42600,
1714 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1715 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1716 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1717 MAV_CMD_WAYPOINT_USER_1 = 31000,
1718 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1719 MAV_CMD_WAYPOINT_USER_2 = 31001,
1720 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1721 MAV_CMD_WAYPOINT_USER_3 = 31002,
1722 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1723 MAV_CMD_WAYPOINT_USER_4 = 31003,
1724 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1725 MAV_CMD_WAYPOINT_USER_5 = 31004,
1726 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1727 MAV_CMD_SPATIAL_USER_1 = 31005,
1728 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1729 MAV_CMD_SPATIAL_USER_2 = 31006,
1730 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1731 MAV_CMD_SPATIAL_USER_3 = 31007,
1732 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1733 MAV_CMD_SPATIAL_USER_4 = 31008,
1734 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1735 MAV_CMD_SPATIAL_USER_5 = 31009,
1736 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1737 MAV_CMD_USER_1 = 31010,
1738 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1739 MAV_CMD_USER_2 = 31011,
1740 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1741 MAV_CMD_USER_3 = 31012,
1742 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1743 MAV_CMD_USER_4 = 31013,
1744 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1745 MAV_CMD_USER_5 = 31014,
1746 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1747 MAV_CMD_CAN_FORWARD = 32000,
1748}
1749impl MavCmd {
1750 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1751}
1752impl Default for MavCmd {
1753 fn default() -> Self {
1754 Self::DEFAULT
1755 }
1756}
1757#[cfg_attr(feature = "ts", derive(TS))]
1758#[cfg_attr(feature = "ts", ts(export))]
1759#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1760#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1761#[cfg_attr(feature = "serde", serde(tag = "type"))]
1762#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1763#[repr(u32)]
1764#[doc = "Possible actions an aircraft can take to avoid a collision."]
1765pub enum MavCollisionAction {
1766 #[doc = "Ignore any potential collisions"]
1767 MAV_COLLISION_ACTION_NONE = 0,
1768 #[doc = "Report potential collision"]
1769 MAV_COLLISION_ACTION_REPORT = 1,
1770 #[doc = "Ascend or Descend to avoid threat"]
1771 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1772 #[doc = "Move horizontally to avoid threat"]
1773 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1774 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1775 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1776 #[doc = "Aircraft to fly directly back to its launch point"]
1777 MAV_COLLISION_ACTION_RTL = 5,
1778 #[doc = "Aircraft to stop in place"]
1779 MAV_COLLISION_ACTION_HOVER = 6,
1780}
1781impl MavCollisionAction {
1782 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1783}
1784impl Default for MavCollisionAction {
1785 fn default() -> Self {
1786 Self::DEFAULT
1787 }
1788}
1789#[cfg_attr(feature = "ts", derive(TS))]
1790#[cfg_attr(feature = "ts", ts(export))]
1791#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1792#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1793#[cfg_attr(feature = "serde", serde(tag = "type"))]
1794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1795#[repr(u32)]
1796#[doc = "Source of information about this collision."]
1797pub enum MavCollisionSrc {
1798 #[doc = "ID field references ADSB_VEHICLE packets"]
1799 MAV_COLLISION_SRC_ADSB = 0,
1800 #[doc = "ID field references MAVLink SRC ID"]
1801 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1802}
1803impl MavCollisionSrc {
1804 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1805}
1806impl Default for MavCollisionSrc {
1807 fn default() -> Self {
1808 Self::DEFAULT
1809 }
1810}
1811#[cfg_attr(feature = "ts", derive(TS))]
1812#[cfg_attr(feature = "ts", ts(export))]
1813#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1814#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1815#[cfg_attr(feature = "serde", serde(tag = "type"))]
1816#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1817#[repr(u32)]
1818#[doc = "Aircraft-rated danger from this threat."]
1819pub enum MavCollisionThreatLevel {
1820 #[doc = "Not a threat"]
1821 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1822 #[doc = "Craft is mildly concerned about this threat"]
1823 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1824 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1825 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1826}
1827impl MavCollisionThreatLevel {
1828 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1829}
1830impl Default for MavCollisionThreatLevel {
1831 fn default() -> Self {
1832 Self::DEFAULT
1833 }
1834}
1835#[cfg_attr(feature = "ts", derive(TS))]
1836#[cfg_attr(feature = "ts", ts(export))]
1837#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1838#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1839#[cfg_attr(feature = "serde", serde(tag = "type"))]
1840#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1841#[repr(u32)]
1842#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1843pub enum MavComponent {
1844 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1845 MAV_COMP_ID_ALL = 0,
1846 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1847 MAV_COMP_ID_AUTOPILOT1 = 1,
1848 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1849 MAV_COMP_ID_USER1 = 25,
1850 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1851 MAV_COMP_ID_USER2 = 26,
1852 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1853 MAV_COMP_ID_USER3 = 27,
1854 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1855 MAV_COMP_ID_USER4 = 28,
1856 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1857 MAV_COMP_ID_USER5 = 29,
1858 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1859 MAV_COMP_ID_USER6 = 30,
1860 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1861 MAV_COMP_ID_USER7 = 31,
1862 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1863 MAV_COMP_ID_USER8 = 32,
1864 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1865 MAV_COMP_ID_USER9 = 33,
1866 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1867 MAV_COMP_ID_USER10 = 34,
1868 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1869 MAV_COMP_ID_USER11 = 35,
1870 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1871 MAV_COMP_ID_USER12 = 36,
1872 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1873 MAV_COMP_ID_USER13 = 37,
1874 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1875 MAV_COMP_ID_USER14 = 38,
1876 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1877 MAV_COMP_ID_USER15 = 39,
1878 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1879 MAV_COMP_ID_USER16 = 40,
1880 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1881 MAV_COMP_ID_USER17 = 41,
1882 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1883 MAV_COMP_ID_USER18 = 42,
1884 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1885 MAV_COMP_ID_USER19 = 43,
1886 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1887 MAV_COMP_ID_USER20 = 44,
1888 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1889 MAV_COMP_ID_USER21 = 45,
1890 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1891 MAV_COMP_ID_USER22 = 46,
1892 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1893 MAV_COMP_ID_USER23 = 47,
1894 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1895 MAV_COMP_ID_USER24 = 48,
1896 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1897 MAV_COMP_ID_USER25 = 49,
1898 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1899 MAV_COMP_ID_USER26 = 50,
1900 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1901 MAV_COMP_ID_USER27 = 51,
1902 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1903 MAV_COMP_ID_USER28 = 52,
1904 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1905 MAV_COMP_ID_USER29 = 53,
1906 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1907 MAV_COMP_ID_USER30 = 54,
1908 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1909 MAV_COMP_ID_USER31 = 55,
1910 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1911 MAV_COMP_ID_USER32 = 56,
1912 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1913 MAV_COMP_ID_USER33 = 57,
1914 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1915 MAV_COMP_ID_USER34 = 58,
1916 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1917 MAV_COMP_ID_USER35 = 59,
1918 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1919 MAV_COMP_ID_USER36 = 60,
1920 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1921 MAV_COMP_ID_USER37 = 61,
1922 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1923 MAV_COMP_ID_USER38 = 62,
1924 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1925 MAV_COMP_ID_USER39 = 63,
1926 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1927 MAV_COMP_ID_USER40 = 64,
1928 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1929 MAV_COMP_ID_USER41 = 65,
1930 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1931 MAV_COMP_ID_USER42 = 66,
1932 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1933 MAV_COMP_ID_USER43 = 67,
1934 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1935 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1936 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1937 MAV_COMP_ID_USER45 = 69,
1938 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1939 MAV_COMP_ID_USER46 = 70,
1940 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1941 MAV_COMP_ID_USER47 = 71,
1942 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1943 MAV_COMP_ID_USER48 = 72,
1944 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1945 MAV_COMP_ID_USER49 = 73,
1946 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1947 MAV_COMP_ID_USER50 = 74,
1948 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1949 MAV_COMP_ID_USER51 = 75,
1950 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1951 MAV_COMP_ID_USER52 = 76,
1952 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1953 MAV_COMP_ID_USER53 = 77,
1954 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1955 MAV_COMP_ID_USER54 = 78,
1956 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1957 MAV_COMP_ID_USER55 = 79,
1958 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1959 MAV_COMP_ID_USER56 = 80,
1960 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1961 MAV_COMP_ID_USER57 = 81,
1962 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1963 MAV_COMP_ID_USER58 = 82,
1964 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1965 MAV_COMP_ID_USER59 = 83,
1966 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1967 MAV_COMP_ID_USER60 = 84,
1968 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1969 MAV_COMP_ID_USER61 = 85,
1970 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1971 MAV_COMP_ID_USER62 = 86,
1972 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1973 MAV_COMP_ID_USER63 = 87,
1974 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1975 MAV_COMP_ID_USER64 = 88,
1976 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1977 MAV_COMP_ID_USER65 = 89,
1978 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1979 MAV_COMP_ID_USER66 = 90,
1980 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1981 MAV_COMP_ID_USER67 = 91,
1982 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1983 MAV_COMP_ID_USER68 = 92,
1984 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1985 MAV_COMP_ID_USER69 = 93,
1986 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1987 MAV_COMP_ID_USER70 = 94,
1988 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1989 MAV_COMP_ID_USER71 = 95,
1990 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1991 MAV_COMP_ID_USER72 = 96,
1992 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1993 MAV_COMP_ID_USER73 = 97,
1994 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1995 MAV_COMP_ID_USER74 = 98,
1996 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1997 MAV_COMP_ID_USER75 = 99,
1998 #[doc = "Camera #1."]
1999 MAV_COMP_ID_CAMERA = 100,
2000 #[doc = "Camera #2."]
2001 MAV_COMP_ID_CAMERA2 = 101,
2002 #[doc = "Camera #3."]
2003 MAV_COMP_ID_CAMERA3 = 102,
2004 #[doc = "Camera #4."]
2005 MAV_COMP_ID_CAMERA4 = 103,
2006 #[doc = "Camera #5."]
2007 MAV_COMP_ID_CAMERA5 = 104,
2008 #[doc = "Camera #6."]
2009 MAV_COMP_ID_CAMERA6 = 105,
2010 #[doc = "Servo #1."]
2011 MAV_COMP_ID_SERVO1 = 140,
2012 #[doc = "Servo #2."]
2013 MAV_COMP_ID_SERVO2 = 141,
2014 #[doc = "Servo #3."]
2015 MAV_COMP_ID_SERVO3 = 142,
2016 #[doc = "Servo #4."]
2017 MAV_COMP_ID_SERVO4 = 143,
2018 #[doc = "Servo #5."]
2019 MAV_COMP_ID_SERVO5 = 144,
2020 #[doc = "Servo #6."]
2021 MAV_COMP_ID_SERVO6 = 145,
2022 #[doc = "Servo #7."]
2023 MAV_COMP_ID_SERVO7 = 146,
2024 #[doc = "Servo #8."]
2025 MAV_COMP_ID_SERVO8 = 147,
2026 #[doc = "Servo #9."]
2027 MAV_COMP_ID_SERVO9 = 148,
2028 #[doc = "Servo #10."]
2029 MAV_COMP_ID_SERVO10 = 149,
2030 #[doc = "Servo #11."]
2031 MAV_COMP_ID_SERVO11 = 150,
2032 #[doc = "Servo #12."]
2033 MAV_COMP_ID_SERVO12 = 151,
2034 #[doc = "Servo #13."]
2035 MAV_COMP_ID_SERVO13 = 152,
2036 #[doc = "Servo #14."]
2037 MAV_COMP_ID_SERVO14 = 153,
2038 #[doc = "Gimbal #1."]
2039 MAV_COMP_ID_GIMBAL = 154,
2040 #[doc = "Logging component."]
2041 MAV_COMP_ID_LOG = 155,
2042 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
2043 MAV_COMP_ID_ADSB = 156,
2044 #[doc = "On Screen Display (OSD) devices for video links."]
2045 MAV_COMP_ID_OSD = 157,
2046 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
2047 MAV_COMP_ID_PERIPHERAL = 158,
2048 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
2049 #[doc = "Gimbal ID for QX1."]
2050 MAV_COMP_ID_QX1_GIMBAL = 159,
2051 #[doc = "FLARM collision alert component."]
2052 MAV_COMP_ID_FLARM = 160,
2053 #[doc = "Parachute component."]
2054 MAV_COMP_ID_PARACHUTE = 161,
2055 #[doc = "Winch component."]
2056 MAV_COMP_ID_WINCH = 169,
2057 #[doc = "Gimbal #2."]
2058 MAV_COMP_ID_GIMBAL2 = 171,
2059 #[doc = "Gimbal #3."]
2060 MAV_COMP_ID_GIMBAL3 = 172,
2061 #[doc = "Gimbal #4"]
2062 MAV_COMP_ID_GIMBAL4 = 173,
2063 #[doc = "Gimbal #5."]
2064 MAV_COMP_ID_GIMBAL5 = 174,
2065 #[doc = "Gimbal #6."]
2066 MAV_COMP_ID_GIMBAL6 = 175,
2067 #[doc = "Battery #1."]
2068 MAV_COMP_ID_BATTERY = 180,
2069 #[doc = "Battery #2."]
2070 MAV_COMP_ID_BATTERY2 = 181,
2071 #[doc = "CAN over MAVLink client."]
2072 MAV_COMP_ID_MAVCAN = 189,
2073 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
2074 MAV_COMP_ID_MISSIONPLANNER = 190,
2075 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2076 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
2077 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2078 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
2079 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2080 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
2081 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2082 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
2083 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
2084 MAV_COMP_ID_PATHPLANNER = 195,
2085 #[doc = "Component that plans a collision free path between two points."]
2086 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2087 #[doc = "Component that provides position estimates using VIO techniques."]
2088 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2089 #[doc = "Component that manages pairing of vehicle and GCS."]
2090 MAV_COMP_ID_PAIRING_MANAGER = 198,
2091 #[doc = "Inertial Measurement Unit (IMU) #1."]
2092 MAV_COMP_ID_IMU = 200,
2093 #[doc = "Inertial Measurement Unit (IMU) #2."]
2094 MAV_COMP_ID_IMU_2 = 201,
2095 #[doc = "Inertial Measurement Unit (IMU) #3."]
2096 MAV_COMP_ID_IMU_3 = 202,
2097 #[doc = "GPS #1."]
2098 MAV_COMP_ID_GPS = 220,
2099 #[doc = "GPS #2."]
2100 MAV_COMP_ID_GPS2 = 221,
2101 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2102 MAV_COMP_ID_ODID_TXRX_1 = 236,
2103 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2104 MAV_COMP_ID_ODID_TXRX_2 = 237,
2105 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2106 MAV_COMP_ID_ODID_TXRX_3 = 238,
2107 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2108 MAV_COMP_ID_UDP_BRIDGE = 240,
2109 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2110 MAV_COMP_ID_UART_BRIDGE = 241,
2111 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2112 MAV_COMP_ID_TUNNEL_NODE = 242,
2113 #[doc = "Illuminator"]
2114 MAV_COMP_ID_ILLUMINATOR = 243,
2115 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2116 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2117 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2118}
2119impl MavComponent {
2120 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2121}
2122impl Default for MavComponent {
2123 fn default() -> Self {
2124 Self::DEFAULT
2125 }
2126}
2127#[cfg_attr(feature = "ts", derive(TS))]
2128#[cfg_attr(feature = "ts", ts(export))]
2129#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2131#[cfg_attr(feature = "serde", serde(tag = "type"))]
2132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2133#[repr(u32)]
2134#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2135#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2136pub enum MavDataStream {
2137 #[doc = "Enable all data streams"]
2138 MAV_DATA_STREAM_ALL = 0,
2139 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2140 MAV_DATA_STREAM_RAW_SENSORS = 1,
2141 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2142 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2143 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2144 MAV_DATA_STREAM_RC_CHANNELS = 3,
2145 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2146 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2147 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2148 MAV_DATA_STREAM_POSITION = 6,
2149 #[doc = "Dependent on the autopilot"]
2150 MAV_DATA_STREAM_EXTRA1 = 10,
2151 #[doc = "Dependent on the autopilot"]
2152 MAV_DATA_STREAM_EXTRA2 = 11,
2153 #[doc = "Dependent on the autopilot"]
2154 MAV_DATA_STREAM_EXTRA3 = 12,
2155}
2156impl MavDataStream {
2157 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2158}
2159impl Default for MavDataStream {
2160 fn default() -> Self {
2161 Self::DEFAULT
2162 }
2163}
2164#[cfg_attr(feature = "ts", derive(TS))]
2165#[cfg_attr(feature = "ts", ts(export))]
2166#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2168#[cfg_attr(feature = "serde", serde(tag = "type"))]
2169#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2170#[repr(u32)]
2171#[doc = "Enumeration of distance sensor types"]
2172pub enum MavDistanceSensor {
2173 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2174 MAV_DISTANCE_SENSOR_LASER = 0,
2175 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2176 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2177 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2178 MAV_DISTANCE_SENSOR_INFRARED = 2,
2179 #[doc = "Radar type, e.g. uLanding units"]
2180 MAV_DISTANCE_SENSOR_RADAR = 3,
2181 #[doc = "Broken or unknown type, e.g. analog units"]
2182 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2183}
2184impl MavDistanceSensor {
2185 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2186}
2187impl Default for MavDistanceSensor {
2188 fn default() -> Self {
2189 Self::DEFAULT
2190 }
2191}
2192#[cfg_attr(feature = "ts", derive(TS))]
2193#[cfg_attr(feature = "ts", ts(export))]
2194#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2195#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2196#[cfg_attr(feature = "serde", serde(tag = "type"))]
2197#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2198#[repr(u32)]
2199#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2200pub enum MavDoRepositionFlags {
2201 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2202 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2203}
2204impl MavDoRepositionFlags {
2205 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2206}
2207impl Default for MavDoRepositionFlags {
2208 fn default() -> Self {
2209 Self::DEFAULT
2210 }
2211}
2212#[cfg_attr(feature = "ts", derive(TS))]
2213#[cfg_attr(feature = "ts", ts(export))]
2214#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2216#[cfg_attr(feature = "serde", serde(tag = "type"))]
2217#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2218#[repr(u32)]
2219#[doc = "Enumeration of estimator types"]
2220pub enum MavEstimatorType {
2221 #[doc = "Unknown type of the estimator."]
2222 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2223 #[doc = "This is a naive estimator without any real covariance feedback."]
2224 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2225 #[doc = "Computer vision based estimate. Might be up to scale."]
2226 MAV_ESTIMATOR_TYPE_VISION = 2,
2227 #[doc = "Visual-inertial estimate."]
2228 MAV_ESTIMATOR_TYPE_VIO = 3,
2229 #[doc = "Plain GPS estimate."]
2230 MAV_ESTIMATOR_TYPE_GPS = 4,
2231 #[doc = "Estimator integrating GPS and inertial sensing."]
2232 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2233 #[doc = "Estimate from external motion capturing system."]
2234 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2235 #[doc = "Estimator based on lidar sensor input."]
2236 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2237 #[doc = "Estimator on autopilot."]
2238 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2239}
2240impl MavEstimatorType {
2241 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2242}
2243impl Default for MavEstimatorType {
2244 fn default() -> Self {
2245 Self::DEFAULT
2246 }
2247}
2248#[cfg_attr(feature = "ts", derive(TS))]
2249#[cfg_attr(feature = "ts", ts(export))]
2250#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2251#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2252#[cfg_attr(feature = "serde", serde(tag = "type"))]
2253#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2254#[repr(u32)]
2255#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2256pub enum MavEventCurrentSequenceFlags {
2257 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2258 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2259}
2260impl MavEventCurrentSequenceFlags {
2261 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2262}
2263impl Default for MavEventCurrentSequenceFlags {
2264 fn default() -> Self {
2265 Self::DEFAULT
2266 }
2267}
2268#[cfg_attr(feature = "ts", derive(TS))]
2269#[cfg_attr(feature = "ts", ts(export))]
2270#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2272#[cfg_attr(feature = "serde", serde(tag = "type"))]
2273#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2274#[repr(u32)]
2275#[doc = "Reason for an event error response."]
2276pub enum MavEventErrorReason {
2277 #[doc = "The requested event is not available (anymore)."]
2278 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2279}
2280impl MavEventErrorReason {
2281 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2282}
2283impl Default for MavEventErrorReason {
2284 fn default() -> Self {
2285 Self::DEFAULT
2286 }
2287}
2288#[cfg_attr(feature = "ts", derive(TS))]
2289#[cfg_attr(feature = "ts", ts(export))]
2290#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2291#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2292#[cfg_attr(feature = "serde", serde(tag = "type"))]
2293#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2294#[repr(u32)]
2295#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2296pub enum MavFrame {
2297 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2298 MAV_FRAME_GLOBAL = 0,
2299 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2300 MAV_FRAME_LOCAL_NED = 1,
2301 #[doc = "NOT a coordinate frame, indicates a mission command."]
2302 MAV_FRAME_MISSION = 2,
2303 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2304 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2305 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2306 MAV_FRAME_LOCAL_ENU = 4,
2307 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2308 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2309 MAV_FRAME_GLOBAL_INT = 5,
2310 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2311 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2312 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2313 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2314 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2315 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2316 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2317 MAV_FRAME_BODY_NED = 8,
2318 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2319 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2320 MAV_FRAME_BODY_OFFSET_NED = 9,
2321 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2322 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2323 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2324 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2325 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2326 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2327 MAV_FRAME_BODY_FRD = 12,
2328 #[deprecated = " (Deprecated since 2019-04)"]
2329 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2330 MAV_FRAME_RESERVED_13 = 13,
2331 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2332 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2333 MAV_FRAME_RESERVED_14 = 14,
2334 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2335 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2336 MAV_FRAME_RESERVED_15 = 15,
2337 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2338 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2339 MAV_FRAME_RESERVED_16 = 16,
2340 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2341 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2342 MAV_FRAME_RESERVED_17 = 17,
2343 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2344 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2345 MAV_FRAME_RESERVED_18 = 18,
2346 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2347 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2348 MAV_FRAME_RESERVED_19 = 19,
2349 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2350 MAV_FRAME_LOCAL_FRD = 20,
2351 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2352 MAV_FRAME_LOCAL_FLU = 21,
2353}
2354impl MavFrame {
2355 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2356}
2357impl Default for MavFrame {
2358 fn default() -> Self {
2359 Self::DEFAULT
2360 }
2361}
2362#[cfg_attr(feature = "ts", derive(TS))]
2363#[cfg_attr(feature = "ts", ts(export))]
2364#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2366#[cfg_attr(feature = "serde", serde(tag = "type"))]
2367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2368#[repr(u32)]
2369#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2370pub enum MavFtpErr {
2371 #[doc = "None: No error"]
2372 MAV_FTP_ERR_NONE = 0,
2373 #[doc = "Fail: Unknown failure"]
2374 MAV_FTP_ERR_FAIL = 1,
2375 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2376 MAV_FTP_ERR_FAILERRNO = 2,
2377 #[doc = "InvalidDataSize: Payload size is invalid"]
2378 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2379 #[doc = "InvalidSession: Session is not currently open"]
2380 MAV_FTP_ERR_INVALIDSESSION = 4,
2381 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2382 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2383 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2384 MAV_FTP_ERR_EOF = 6,
2385 #[doc = "UnknownCommand: Unknown command / opcode"]
2386 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2387 #[doc = "FileExists: File/directory already exists"]
2388 MAV_FTP_ERR_FILEEXISTS = 8,
2389 #[doc = "FileProtected: File/directory is write protected"]
2390 MAV_FTP_ERR_FILEPROTECTED = 9,
2391 #[doc = "FileNotFound: File/directory not found"]
2392 MAV_FTP_ERR_FILENOTFOUND = 10,
2393}
2394impl MavFtpErr {
2395 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2396}
2397impl Default for MavFtpErr {
2398 fn default() -> Self {
2399 Self::DEFAULT
2400 }
2401}
2402#[cfg_attr(feature = "ts", derive(TS))]
2403#[cfg_attr(feature = "ts", ts(export))]
2404#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2406#[cfg_attr(feature = "serde", serde(tag = "type"))]
2407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2408#[repr(u32)]
2409#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2410pub enum MavFtpOpcode {
2411 #[doc = "None. Ignored, always ACKed"]
2412 MAV_FTP_OPCODE_NONE = 0,
2413 #[doc = "TerminateSession: Terminates open Read session"]
2414 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2415 #[doc = "ResetSessions: Terminates all open read sessions"]
2416 MAV_FTP_OPCODE_RESETSESSION = 2,
2417 #[doc = "ListDirectory. List files and directories in path from offset"]
2418 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2419 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2420 MAV_FTP_OPCODE_OPENFILERO = 4,
2421 #[doc = "ReadFile: Reads size bytes from offset in session"]
2422 MAV_FTP_OPCODE_READFILE = 5,
2423 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2424 MAV_FTP_OPCODE_CREATEFILE = 6,
2425 #[doc = "WriteFile: Writes size bytes to offset in session"]
2426 MAV_FTP_OPCODE_WRITEFILE = 7,
2427 #[doc = "RemoveFile: Remove file at path"]
2428 MAV_FTP_OPCODE_REMOVEFILE = 8,
2429 #[doc = "CreateDirectory: Creates directory at path"]
2430 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2431 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2432 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2433 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2434 MAV_FTP_OPCODE_OPENFILEWO = 11,
2435 #[doc = "TruncateFile: Truncate file at path to offset length"]
2436 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2437 #[doc = "Rename: Rename path1 to path2"]
2438 MAV_FTP_OPCODE_RENAME = 13,
2439 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2440 MAV_FTP_OPCODE_CALCFILECRC = 14,
2441 #[doc = "BurstReadFile: Burst download session file"]
2442 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2443 #[doc = "ACK: ACK response"]
2444 MAV_FTP_OPCODE_ACK = 128,
2445 #[doc = "NAK: NAK response"]
2446 MAV_FTP_OPCODE_NAK = 129,
2447}
2448impl MavFtpOpcode {
2449 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2450}
2451impl Default for MavFtpOpcode {
2452 fn default() -> Self {
2453 Self::DEFAULT
2454 }
2455}
2456#[cfg_attr(feature = "ts", derive(TS))]
2457#[cfg_attr(feature = "ts", ts(export))]
2458#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2459#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2460#[cfg_attr(feature = "serde", serde(tag = "type"))]
2461#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2462#[repr(u32)]
2463#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2464pub enum MavFuelType {
2465 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2466 MAV_FUEL_TYPE_UNKNOWN = 0,
2467 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2468 MAV_FUEL_TYPE_LIQUID = 1,
2469 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2470 MAV_FUEL_TYPE_GAS = 2,
2471}
2472impl MavFuelType {
2473 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2474}
2475impl Default for MavFuelType {
2476 fn default() -> Self {
2477 Self::DEFAULT
2478 }
2479}
2480bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2481impl MavGeneratorStatusFlag {
2482 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2483}
2484impl Default for MavGeneratorStatusFlag {
2485 fn default() -> Self {
2486 Self::DEFAULT
2487 }
2488}
2489#[cfg_attr(feature = "ts", derive(TS))]
2490#[cfg_attr(feature = "ts", ts(export))]
2491#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2492#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2493#[cfg_attr(feature = "serde", serde(tag = "type"))]
2494#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2495#[repr(u32)]
2496#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2497pub enum MavGoto {
2498 #[doc = "Hold at the current position."]
2499 MAV_GOTO_DO_HOLD = 0,
2500 #[doc = "Continue with the next item in mission execution."]
2501 MAV_GOTO_DO_CONTINUE = 1,
2502 #[doc = "Hold at the current position of the system"]
2503 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2504 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2505 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2506}
2507impl MavGoto {
2508 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2509}
2510impl Default for MavGoto {
2511 fn default() -> Self {
2512 Self::DEFAULT
2513 }
2514}
2515#[cfg_attr(feature = "ts", derive(TS))]
2516#[cfg_attr(feature = "ts", ts(export))]
2517#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2518#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2519#[cfg_attr(feature = "serde", serde(tag = "type"))]
2520#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2521#[repr(u32)]
2522#[doc = "Enumeration of landed detector states"]
2523pub enum MavLandedState {
2524 #[doc = "MAV landed state is unknown"]
2525 MAV_LANDED_STATE_UNDEFINED = 0,
2526 #[doc = "MAV is landed (on ground)"]
2527 MAV_LANDED_STATE_ON_GROUND = 1,
2528 #[doc = "MAV is in air"]
2529 MAV_LANDED_STATE_IN_AIR = 2,
2530 #[doc = "MAV currently taking off"]
2531 MAV_LANDED_STATE_TAKEOFF = 3,
2532 #[doc = "MAV currently landing"]
2533 MAV_LANDED_STATE_LANDING = 4,
2534}
2535impl MavLandedState {
2536 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2537}
2538impl Default for MavLandedState {
2539 fn default() -> Self {
2540 Self::DEFAULT
2541 }
2542}
2543#[cfg_attr(feature = "ts", derive(TS))]
2544#[cfg_attr(feature = "ts", ts(export))]
2545#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2546#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2547#[cfg_attr(feature = "serde", serde(tag = "type"))]
2548#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2549#[repr(u32)]
2550#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2551pub enum MavMissionResult {
2552 #[doc = "mission accepted OK"]
2553 MAV_MISSION_ACCEPTED = 0,
2554 #[doc = "Generic error / not accepting mission commands at all right now."]
2555 MAV_MISSION_ERROR = 1,
2556 #[doc = "Coordinate frame is not supported."]
2557 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2558 #[doc = "Command is not supported."]
2559 MAV_MISSION_UNSUPPORTED = 3,
2560 #[doc = "Mission items exceed storage space."]
2561 MAV_MISSION_NO_SPACE = 4,
2562 #[doc = "One of the parameters has an invalid value."]
2563 MAV_MISSION_INVALID = 5,
2564 #[doc = "param1 has an invalid value."]
2565 MAV_MISSION_INVALID_PARAM1 = 6,
2566 #[doc = "param2 has an invalid value."]
2567 MAV_MISSION_INVALID_PARAM2 = 7,
2568 #[doc = "param3 has an invalid value."]
2569 MAV_MISSION_INVALID_PARAM3 = 8,
2570 #[doc = "param4 has an invalid value."]
2571 MAV_MISSION_INVALID_PARAM4 = 9,
2572 #[doc = "x / param5 has an invalid value."]
2573 MAV_MISSION_INVALID_PARAM5_X = 10,
2574 #[doc = "y / param6 has an invalid value."]
2575 MAV_MISSION_INVALID_PARAM6_Y = 11,
2576 #[doc = "z / param7 has an invalid value."]
2577 MAV_MISSION_INVALID_PARAM7 = 12,
2578 #[doc = "Mission item received out of sequence"]
2579 MAV_MISSION_INVALID_SEQUENCE = 13,
2580 #[doc = "Not accepting any mission commands from this communication partner."]
2581 MAV_MISSION_DENIED = 14,
2582 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2583 MAV_MISSION_OPERATION_CANCELLED = 15,
2584}
2585impl MavMissionResult {
2586 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2587}
2588impl Default for MavMissionResult {
2589 fn default() -> Self {
2590 Self::DEFAULT
2591 }
2592}
2593#[cfg_attr(feature = "ts", derive(TS))]
2594#[cfg_attr(feature = "ts", ts(export))]
2595#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2596#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2597#[cfg_attr(feature = "serde", serde(tag = "type"))]
2598#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2599#[repr(u32)]
2600#[doc = "Type of mission items being requested/sent in mission protocol."]
2601pub enum MavMissionType {
2602 #[doc = "Items are mission commands for main mission."]
2603 MAV_MISSION_TYPE_MISSION = 0,
2604 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2605 MAV_MISSION_TYPE_FENCE = 1,
2606 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2607 MAV_MISSION_TYPE_RALLY = 2,
2608 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2609 MAV_MISSION_TYPE_ALL = 255,
2610}
2611impl MavMissionType {
2612 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2613}
2614impl Default for MavMissionType {
2615 fn default() -> Self {
2616 Self::DEFAULT
2617 }
2618}
2619#[cfg_attr(feature = "ts", derive(TS))]
2620#[cfg_attr(feature = "ts", ts(export))]
2621#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2622#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2623#[cfg_attr(feature = "serde", serde(tag = "type"))]
2624#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2625#[repr(u32)]
2626#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2627pub enum MavMode {
2628 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2629 MAV_MODE_PREFLIGHT = 0,
2630 #[doc = "System is allowed to be active, under assisted RC control."]
2631 MAV_MODE_STABILIZE_DISARMED = 80,
2632 #[doc = "System is allowed to be active, under assisted RC control."]
2633 MAV_MODE_STABILIZE_ARMED = 208,
2634 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2635 MAV_MODE_MANUAL_DISARMED = 64,
2636 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2637 MAV_MODE_MANUAL_ARMED = 192,
2638 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2639 MAV_MODE_GUIDED_DISARMED = 88,
2640 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2641 MAV_MODE_GUIDED_ARMED = 216,
2642 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2643 MAV_MODE_AUTO_DISARMED = 92,
2644 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2645 MAV_MODE_AUTO_ARMED = 220,
2646 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2647 MAV_MODE_TEST_DISARMED = 66,
2648 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2649 MAV_MODE_TEST_ARMED = 194,
2650}
2651impl MavMode {
2652 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2653}
2654impl Default for MavMode {
2655 fn default() -> Self {
2656 Self::DEFAULT
2657 }
2658}
2659bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2660impl MavModeFlag {
2661 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2662}
2663impl Default for MavModeFlag {
2664 fn default() -> Self {
2665 Self::DEFAULT
2666 }
2667}
2668#[cfg_attr(feature = "ts", derive(TS))]
2669#[cfg_attr(feature = "ts", ts(export))]
2670#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2672#[cfg_attr(feature = "serde", serde(tag = "type"))]
2673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2674#[repr(u32)]
2675#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2676pub enum MavModeFlagDecodePosition {
2677 #[doc = "First bit: 10000000"]
2678 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2679 #[doc = "Second bit: 01000000"]
2680 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2681 #[doc = "Third bit: 00100000"]
2682 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2683 #[doc = "Fourth bit: 00010000"]
2684 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2685 #[doc = "Fifth bit: 00001000"]
2686 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2687 #[doc = "Sixth bit: 00000100"]
2688 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2689 #[doc = "Seventh bit: 00000010"]
2690 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2691 #[doc = "Eighth bit: 00000001"]
2692 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2693}
2694impl MavModeFlagDecodePosition {
2695 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2696}
2697impl Default for MavModeFlagDecodePosition {
2698 fn default() -> Self {
2699 Self::DEFAULT
2700 }
2701}
2702bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2703impl MavModeProperty {
2704 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2705}
2706impl Default for MavModeProperty {
2707 fn default() -> Self {
2708 Self::DEFAULT
2709 }
2710}
2711#[cfg_attr(feature = "ts", derive(TS))]
2712#[cfg_attr(feature = "ts", ts(export))]
2713#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2714#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2715#[cfg_attr(feature = "serde", serde(tag = "type"))]
2716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2717#[repr(u32)]
2718#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2719#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2720pub enum MavMountMode {
2721 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2722 MAV_MOUNT_MODE_RETRACT = 0,
2723 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2724 MAV_MOUNT_MODE_NEUTRAL = 1,
2725 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2726 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2727 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2728 MAV_MOUNT_MODE_RC_TARGETING = 3,
2729 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2730 MAV_MOUNT_MODE_GPS_POINT = 4,
2731 #[doc = "Gimbal tracks system with specified system ID"]
2732 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2733 #[doc = "Gimbal tracks home position"]
2734 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2735}
2736impl MavMountMode {
2737 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2738}
2739impl Default for MavMountMode {
2740 fn default() -> Self {
2741 Self::DEFAULT
2742 }
2743}
2744#[cfg_attr(feature = "ts", derive(TS))]
2745#[cfg_attr(feature = "ts", ts(export))]
2746#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2747#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2748#[cfg_attr(feature = "serde", serde(tag = "type"))]
2749#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2750#[repr(u32)]
2751pub enum MavOdidArmStatus {
2752 #[doc = "Passing arming checks."]
2753 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2754 #[doc = "Generic arming failure, see error string for details."]
2755 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2756}
2757impl MavOdidArmStatus {
2758 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2759}
2760impl Default for MavOdidArmStatus {
2761 fn default() -> Self {
2762 Self::DEFAULT
2763 }
2764}
2765#[cfg_attr(feature = "ts", derive(TS))]
2766#[cfg_attr(feature = "ts", ts(export))]
2767#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2768#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2769#[cfg_attr(feature = "serde", serde(tag = "type"))]
2770#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2771#[repr(u32)]
2772pub enum MavOdidAuthType {
2773 #[doc = "No authentication type is specified."]
2774 MAV_ODID_AUTH_TYPE_NONE = 0,
2775 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2776 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2777 #[doc = "Signature for the Operator ID."]
2778 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2779 #[doc = "Signature for the entire message set."]
2780 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2781 #[doc = "Authentication is provided by Network Remote ID."]
2782 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2783 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2784 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2785}
2786impl MavOdidAuthType {
2787 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2788}
2789impl Default for MavOdidAuthType {
2790 fn default() -> Self {
2791 Self::DEFAULT
2792 }
2793}
2794#[cfg_attr(feature = "ts", derive(TS))]
2795#[cfg_attr(feature = "ts", ts(export))]
2796#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2797#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2798#[cfg_attr(feature = "serde", serde(tag = "type"))]
2799#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2800#[repr(u32)]
2801pub enum MavOdidCategoryEu {
2802 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2803 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2804 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2805 MAV_ODID_CATEGORY_EU_OPEN = 1,
2806 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2807 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2808 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2809 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2810}
2811impl MavOdidCategoryEu {
2812 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2813}
2814impl Default for MavOdidCategoryEu {
2815 fn default() -> Self {
2816 Self::DEFAULT
2817 }
2818}
2819#[cfg_attr(feature = "ts", derive(TS))]
2820#[cfg_attr(feature = "ts", ts(export))]
2821#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2822#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2823#[cfg_attr(feature = "serde", serde(tag = "type"))]
2824#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2825#[repr(u32)]
2826pub enum MavOdidClassEu {
2827 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2828 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2829 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2830 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2831 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2832 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2833 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2834 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2835 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2836 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2837 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2838 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2839 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2840 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2841 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2842 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2843}
2844impl MavOdidClassEu {
2845 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2846}
2847impl Default for MavOdidClassEu {
2848 fn default() -> Self {
2849 Self::DEFAULT
2850 }
2851}
2852#[cfg_attr(feature = "ts", derive(TS))]
2853#[cfg_attr(feature = "ts", ts(export))]
2854#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2855#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2856#[cfg_attr(feature = "serde", serde(tag = "type"))]
2857#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2858#[repr(u32)]
2859pub enum MavOdidClassificationType {
2860 #[doc = "The classification type for the UA is undeclared."]
2861 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2862 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2863 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2864}
2865impl MavOdidClassificationType {
2866 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2867}
2868impl Default for MavOdidClassificationType {
2869 fn default() -> Self {
2870 Self::DEFAULT
2871 }
2872}
2873#[cfg_attr(feature = "ts", derive(TS))]
2874#[cfg_attr(feature = "ts", ts(export))]
2875#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2876#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2877#[cfg_attr(feature = "serde", serde(tag = "type"))]
2878#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2879#[repr(u32)]
2880pub enum MavOdidDescType {
2881 #[doc = "Optional free-form text description of the purpose of the flight."]
2882 MAV_ODID_DESC_TYPE_TEXT = 0,
2883 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2884 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2885 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2886 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2887}
2888impl MavOdidDescType {
2889 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2890}
2891impl Default for MavOdidDescType {
2892 fn default() -> Self {
2893 Self::DEFAULT
2894 }
2895}
2896#[cfg_attr(feature = "ts", derive(TS))]
2897#[cfg_attr(feature = "ts", ts(export))]
2898#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2899#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2900#[cfg_attr(feature = "serde", serde(tag = "type"))]
2901#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2902#[repr(u32)]
2903pub enum MavOdidHeightRef {
2904 #[doc = "The height field is relative to the take-off location."]
2905 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2906 #[doc = "The height field is relative to ground."]
2907 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2908}
2909impl MavOdidHeightRef {
2910 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2911}
2912impl Default for MavOdidHeightRef {
2913 fn default() -> Self {
2914 Self::DEFAULT
2915 }
2916}
2917#[cfg_attr(feature = "ts", derive(TS))]
2918#[cfg_attr(feature = "ts", ts(export))]
2919#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2920#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2921#[cfg_attr(feature = "serde", serde(tag = "type"))]
2922#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2923#[repr(u32)]
2924pub enum MavOdidHorAcc {
2925 #[doc = "The horizontal accuracy is unknown."]
2926 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2927 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2928 MAV_ODID_HOR_ACC_10NM = 1,
2929 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2930 MAV_ODID_HOR_ACC_4NM = 2,
2931 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2932 MAV_ODID_HOR_ACC_2NM = 3,
2933 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2934 MAV_ODID_HOR_ACC_1NM = 4,
2935 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2936 MAV_ODID_HOR_ACC_0_5NM = 5,
2937 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2938 MAV_ODID_HOR_ACC_0_3NM = 6,
2939 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2940 MAV_ODID_HOR_ACC_0_1NM = 7,
2941 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2942 MAV_ODID_HOR_ACC_0_05NM = 8,
2943 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2944 MAV_ODID_HOR_ACC_30_METER = 9,
2945 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2946 MAV_ODID_HOR_ACC_10_METER = 10,
2947 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2948 MAV_ODID_HOR_ACC_3_METER = 11,
2949 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2950 MAV_ODID_HOR_ACC_1_METER = 12,
2951}
2952impl MavOdidHorAcc {
2953 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2954}
2955impl Default for MavOdidHorAcc {
2956 fn default() -> Self {
2957 Self::DEFAULT
2958 }
2959}
2960#[cfg_attr(feature = "ts", derive(TS))]
2961#[cfg_attr(feature = "ts", ts(export))]
2962#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2963#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2964#[cfg_attr(feature = "serde", serde(tag = "type"))]
2965#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2966#[repr(u32)]
2967pub enum MavOdidIdType {
2968 #[doc = "No type defined."]
2969 MAV_ODID_ID_TYPE_NONE = 0,
2970 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2971 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2972 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2973 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2974 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2975 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2976 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2977 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2978}
2979impl MavOdidIdType {
2980 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2981}
2982impl Default for MavOdidIdType {
2983 fn default() -> Self {
2984 Self::DEFAULT
2985 }
2986}
2987#[cfg_attr(feature = "ts", derive(TS))]
2988#[cfg_attr(feature = "ts", ts(export))]
2989#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2990#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2991#[cfg_attr(feature = "serde", serde(tag = "type"))]
2992#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2993#[repr(u32)]
2994pub enum MavOdidOperatorIdType {
2995 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2996 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2997}
2998impl MavOdidOperatorIdType {
2999 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
3000}
3001impl Default for MavOdidOperatorIdType {
3002 fn default() -> Self {
3003 Self::DEFAULT
3004 }
3005}
3006#[cfg_attr(feature = "ts", derive(TS))]
3007#[cfg_attr(feature = "ts", ts(export))]
3008#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3009#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3010#[cfg_attr(feature = "serde", serde(tag = "type"))]
3011#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3012#[repr(u32)]
3013pub enum MavOdidOperatorLocationType {
3014 #[doc = "The location/altitude of the operator is the same as the take-off location."]
3015 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
3016 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
3017 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
3018 #[doc = "The location/altitude of the operator are fixed values."]
3019 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
3020}
3021impl MavOdidOperatorLocationType {
3022 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
3023}
3024impl Default for MavOdidOperatorLocationType {
3025 fn default() -> Self {
3026 Self::DEFAULT
3027 }
3028}
3029#[cfg_attr(feature = "ts", derive(TS))]
3030#[cfg_attr(feature = "ts", ts(export))]
3031#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3033#[cfg_attr(feature = "serde", serde(tag = "type"))]
3034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3035#[repr(u32)]
3036pub enum MavOdidSpeedAcc {
3037 #[doc = "The speed accuracy is unknown."]
3038 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
3039 #[doc = "The speed accuracy is smaller than 10 meters per second."]
3040 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
3041 #[doc = "The speed accuracy is smaller than 3 meters per second."]
3042 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
3043 #[doc = "The speed accuracy is smaller than 1 meters per second."]
3044 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
3045 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
3046 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
3047}
3048impl MavOdidSpeedAcc {
3049 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
3050}
3051impl Default for MavOdidSpeedAcc {
3052 fn default() -> Self {
3053 Self::DEFAULT
3054 }
3055}
3056#[cfg_attr(feature = "ts", derive(TS))]
3057#[cfg_attr(feature = "ts", ts(export))]
3058#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3059#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3060#[cfg_attr(feature = "serde", serde(tag = "type"))]
3061#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3062#[repr(u32)]
3063pub enum MavOdidStatus {
3064 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
3065 MAV_ODID_STATUS_UNDECLARED = 0,
3066 #[doc = "The UA is on the ground."]
3067 MAV_ODID_STATUS_GROUND = 1,
3068 #[doc = "The UA is in the air."]
3069 MAV_ODID_STATUS_AIRBORNE = 2,
3070 #[doc = "The UA is having an emergency."]
3071 MAV_ODID_STATUS_EMERGENCY = 3,
3072 #[doc = "The remote ID system is failing or unreliable in some way."]
3073 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
3074}
3075impl MavOdidStatus {
3076 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
3077}
3078impl Default for MavOdidStatus {
3079 fn default() -> Self {
3080 Self::DEFAULT
3081 }
3082}
3083#[cfg_attr(feature = "ts", derive(TS))]
3084#[cfg_attr(feature = "ts", ts(export))]
3085#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3086#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3087#[cfg_attr(feature = "serde", serde(tag = "type"))]
3088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3089#[repr(u32)]
3090pub enum MavOdidTimeAcc {
3091 #[doc = "The timestamp accuracy is unknown."]
3092 MAV_ODID_TIME_ACC_UNKNOWN = 0,
3093 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
3094 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
3095 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
3096 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
3097 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
3098 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
3099 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3100 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3101 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3102 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3103 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3104 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3105 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3106 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3107 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3108 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3109 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3110 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3111 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3112 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3113 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3114 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3115 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3116 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3117 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3118 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3119 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3120 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3121 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3122 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3123}
3124impl MavOdidTimeAcc {
3125 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3126}
3127impl Default for MavOdidTimeAcc {
3128 fn default() -> Self {
3129 Self::DEFAULT
3130 }
3131}
3132#[cfg_attr(feature = "ts", derive(TS))]
3133#[cfg_attr(feature = "ts", ts(export))]
3134#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3135#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3136#[cfg_attr(feature = "serde", serde(tag = "type"))]
3137#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3138#[repr(u32)]
3139pub enum MavOdidUaType {
3140 #[doc = "No UA (Unmanned Aircraft) type defined."]
3141 MAV_ODID_UA_TYPE_NONE = 0,
3142 #[doc = "Aeroplane/Airplane. Fixed wing."]
3143 MAV_ODID_UA_TYPE_AEROPLANE = 1,
3144 #[doc = "Helicopter or multirotor."]
3145 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
3146 #[doc = "Gyroplane."]
3147 MAV_ODID_UA_TYPE_GYROPLANE = 3,
3148 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
3149 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3150 #[doc = "Ornithopter."]
3151 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3152 #[doc = "Glider."]
3153 MAV_ODID_UA_TYPE_GLIDER = 6,
3154 #[doc = "Kite."]
3155 MAV_ODID_UA_TYPE_KITE = 7,
3156 #[doc = "Free Balloon."]
3157 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3158 #[doc = "Captive Balloon."]
3159 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3160 #[doc = "Airship. E.g. a blimp."]
3161 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3162 #[doc = "Free Fall/Parachute (unpowered)."]
3163 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3164 #[doc = "Rocket."]
3165 MAV_ODID_UA_TYPE_ROCKET = 12,
3166 #[doc = "Tethered powered aircraft."]
3167 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3168 #[doc = "Ground Obstacle."]
3169 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3170 #[doc = "Other type of aircraft not listed earlier."]
3171 MAV_ODID_UA_TYPE_OTHER = 15,
3172}
3173impl MavOdidUaType {
3174 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3175}
3176impl Default for MavOdidUaType {
3177 fn default() -> Self {
3178 Self::DEFAULT
3179 }
3180}
3181#[cfg_attr(feature = "ts", derive(TS))]
3182#[cfg_attr(feature = "ts", ts(export))]
3183#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3184#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3185#[cfg_attr(feature = "serde", serde(tag = "type"))]
3186#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3187#[repr(u32)]
3188pub enum MavOdidVerAcc {
3189 #[doc = "The vertical accuracy is unknown."]
3190 MAV_ODID_VER_ACC_UNKNOWN = 0,
3191 #[doc = "The vertical accuracy is smaller than 150 meter."]
3192 MAV_ODID_VER_ACC_150_METER = 1,
3193 #[doc = "The vertical accuracy is smaller than 45 meter."]
3194 MAV_ODID_VER_ACC_45_METER = 2,
3195 #[doc = "The vertical accuracy is smaller than 25 meter."]
3196 MAV_ODID_VER_ACC_25_METER = 3,
3197 #[doc = "The vertical accuracy is smaller than 10 meter."]
3198 MAV_ODID_VER_ACC_10_METER = 4,
3199 #[doc = "The vertical accuracy is smaller than 3 meter."]
3200 MAV_ODID_VER_ACC_3_METER = 5,
3201 #[doc = "The vertical accuracy is smaller than 1 meter."]
3202 MAV_ODID_VER_ACC_1_METER = 6,
3203}
3204impl MavOdidVerAcc {
3205 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3206}
3207impl Default for MavOdidVerAcc {
3208 fn default() -> Self {
3209 Self::DEFAULT
3210 }
3211}
3212#[cfg_attr(feature = "ts", derive(TS))]
3213#[cfg_attr(feature = "ts", ts(export))]
3214#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3216#[cfg_attr(feature = "serde", serde(tag = "type"))]
3217#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3218#[repr(u32)]
3219#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3220pub enum MavParamExtType {
3221 #[doc = "8-bit unsigned integer"]
3222 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3223 #[doc = "8-bit signed integer"]
3224 MAV_PARAM_EXT_TYPE_INT8 = 2,
3225 #[doc = "16-bit unsigned integer"]
3226 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3227 #[doc = "16-bit signed integer"]
3228 MAV_PARAM_EXT_TYPE_INT16 = 4,
3229 #[doc = "32-bit unsigned integer"]
3230 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3231 #[doc = "32-bit signed integer"]
3232 MAV_PARAM_EXT_TYPE_INT32 = 6,
3233 #[doc = "64-bit unsigned integer"]
3234 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3235 #[doc = "64-bit signed integer"]
3236 MAV_PARAM_EXT_TYPE_INT64 = 8,
3237 #[doc = "32-bit floating-point"]
3238 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3239 #[doc = "64-bit floating-point"]
3240 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3241 #[doc = "Custom Type"]
3242 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3243}
3244impl MavParamExtType {
3245 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3246}
3247impl Default for MavParamExtType {
3248 fn default() -> Self {
3249 Self::DEFAULT
3250 }
3251}
3252#[cfg_attr(feature = "ts", derive(TS))]
3253#[cfg_attr(feature = "ts", ts(export))]
3254#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3256#[cfg_attr(feature = "serde", serde(tag = "type"))]
3257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3258#[repr(u32)]
3259#[doc = "Specifies the datatype of a MAVLink parameter."]
3260pub enum MavParamType {
3261 #[doc = "8-bit unsigned integer"]
3262 MAV_PARAM_TYPE_UINT8 = 1,
3263 #[doc = "8-bit signed integer"]
3264 MAV_PARAM_TYPE_INT8 = 2,
3265 #[doc = "16-bit unsigned integer"]
3266 MAV_PARAM_TYPE_UINT16 = 3,
3267 #[doc = "16-bit signed integer"]
3268 MAV_PARAM_TYPE_INT16 = 4,
3269 #[doc = "32-bit unsigned integer"]
3270 MAV_PARAM_TYPE_UINT32 = 5,
3271 #[doc = "32-bit signed integer"]
3272 MAV_PARAM_TYPE_INT32 = 6,
3273 #[doc = "64-bit unsigned integer"]
3274 MAV_PARAM_TYPE_UINT64 = 7,
3275 #[doc = "64-bit signed integer"]
3276 MAV_PARAM_TYPE_INT64 = 8,
3277 #[doc = "32-bit floating-point"]
3278 MAV_PARAM_TYPE_REAL32 = 9,
3279 #[doc = "64-bit floating-point"]
3280 MAV_PARAM_TYPE_REAL64 = 10,
3281}
3282impl MavParamType {
3283 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3284}
3285impl Default for MavParamType {
3286 fn default() -> Self {
3287 Self::DEFAULT
3288 }
3289}
3290bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3291impl MavPowerStatus {
3292 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3293}
3294impl Default for MavPowerStatus {
3295 fn default() -> Self {
3296 Self::DEFAULT
3297 }
3298}
3299bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3300impl MavProtocolCapability {
3301 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3302}
3303impl Default for MavProtocolCapability {
3304 fn default() -> Self {
3305 Self::DEFAULT
3306 }
3307}
3308#[cfg_attr(feature = "ts", derive(TS))]
3309#[cfg_attr(feature = "ts", ts(export))]
3310#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3312#[cfg_attr(feature = "serde", serde(tag = "type"))]
3313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3314#[repr(u32)]
3315#[doc = "Result from a MAVLink command (MAV_CMD)"]
3316pub enum MavResult {
3317 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3318 MAV_RESULT_ACCEPTED = 0,
3319 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3320 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3321 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3322 MAV_RESULT_DENIED = 2,
3323 #[doc = "Command is not supported (unknown)."]
3324 MAV_RESULT_UNSUPPORTED = 3,
3325 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3326 MAV_RESULT_FAILED = 4,
3327 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3328 MAV_RESULT_IN_PROGRESS = 5,
3329 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3330 MAV_RESULT_CANCELLED = 6,
3331 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3332 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3333 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3334 MAV_RESULT_COMMAND_INT_ONLY = 8,
3335 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3336 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3337}
3338impl MavResult {
3339 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3340}
3341impl Default for MavResult {
3342 fn default() -> Self {
3343 Self::DEFAULT
3344 }
3345}
3346#[cfg_attr(feature = "ts", derive(TS))]
3347#[cfg_attr(feature = "ts", ts(export))]
3348#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3349#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3350#[cfg_attr(feature = "serde", serde(tag = "type"))]
3351#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3352#[repr(u32)]
3353#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3354#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3355pub enum MavRoi {
3356 #[doc = "No region of interest."]
3357 MAV_ROI_NONE = 0,
3358 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3359 MAV_ROI_WPNEXT = 1,
3360 #[doc = "Point toward given waypoint."]
3361 MAV_ROI_WPINDEX = 2,
3362 #[doc = "Point toward fixed location."]
3363 MAV_ROI_LOCATION = 3,
3364 #[doc = "Point toward of given id."]
3365 MAV_ROI_TARGET = 4,
3366}
3367impl MavRoi {
3368 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3369}
3370impl Default for MavRoi {
3371 fn default() -> Self {
3372 Self::DEFAULT
3373 }
3374}
3375#[cfg_attr(feature = "ts", derive(TS))]
3376#[cfg_attr(feature = "ts", ts(export))]
3377#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3378#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3379#[cfg_attr(feature = "serde", serde(tag = "type"))]
3380#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3381#[repr(u32)]
3382#[doc = "Enumeration of sensor orientation, according to its rotations"]
3383pub enum MavSensorOrientation {
3384 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3385 MAV_SENSOR_ROTATION_NONE = 0,
3386 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3387 MAV_SENSOR_ROTATION_YAW_45 = 1,
3388 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3389 MAV_SENSOR_ROTATION_YAW_90 = 2,
3390 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3391 MAV_SENSOR_ROTATION_YAW_135 = 3,
3392 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3393 MAV_SENSOR_ROTATION_YAW_180 = 4,
3394 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3395 MAV_SENSOR_ROTATION_YAW_225 = 5,
3396 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3397 MAV_SENSOR_ROTATION_YAW_270 = 6,
3398 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3399 MAV_SENSOR_ROTATION_YAW_315 = 7,
3400 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3401 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3402 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3403 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3404 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3405 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3406 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3407 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3408 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3409 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3410 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3411 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3412 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3413 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3414 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3415 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3416 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3417 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3418 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3419 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3420 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3421 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3422 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3423 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3424 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3425 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3426 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3427 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3428 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3429 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3430 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3431 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3432 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3433 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3434 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3435 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3436 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3437 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3438 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3439 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3440 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3441 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3442 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3443 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3444 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3445 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3446 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3447 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3448 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3449 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3450 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3451 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3452 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3453 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3454 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3455 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3456 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3457 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3458 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3459 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3460 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3461 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3462 #[doc = "Pitch: 315"]
3463 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3464 #[doc = "Roll: 90, Pitch: 315"]
3465 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3466 #[doc = "Custom orientation"]
3467 MAV_SENSOR_ROTATION_CUSTOM = 100,
3468}
3469impl MavSensorOrientation {
3470 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3471}
3472impl Default for MavSensorOrientation {
3473 fn default() -> Self {
3474 Self::DEFAULT
3475 }
3476}
3477#[cfg_attr(feature = "ts", derive(TS))]
3478#[cfg_attr(feature = "ts", ts(export))]
3479#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3480#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3481#[cfg_attr(feature = "serde", serde(tag = "type"))]
3482#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3483#[repr(u32)]
3484#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3485pub enum MavSeverity {
3486 #[doc = "System is unusable. This is a \"panic\" condition."]
3487 MAV_SEVERITY_EMERGENCY = 0,
3488 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3489 MAV_SEVERITY_ALERT = 1,
3490 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3491 MAV_SEVERITY_CRITICAL = 2,
3492 #[doc = "Indicates an error in secondary/redundant systems."]
3493 MAV_SEVERITY_ERROR = 3,
3494 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3495 MAV_SEVERITY_WARNING = 4,
3496 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3497 MAV_SEVERITY_NOTICE = 5,
3498 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3499 MAV_SEVERITY_INFO = 6,
3500 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3501 MAV_SEVERITY_DEBUG = 7,
3502}
3503impl MavSeverity {
3504 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3505}
3506impl Default for MavSeverity {
3507 fn default() -> Self {
3508 Self::DEFAULT
3509 }
3510}
3511#[cfg_attr(feature = "ts", derive(TS))]
3512#[cfg_attr(feature = "ts", ts(export))]
3513#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3514#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3515#[cfg_attr(feature = "serde", serde(tag = "type"))]
3516#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3517#[repr(u32)]
3518#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3519pub enum MavStandardMode {
3520 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3521 MAV_STANDARD_MODE_NON_STANDARD = 0,
3522 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3523 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3524 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3525 MAV_STANDARD_MODE_ORBIT = 2,
3526 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3527 MAV_STANDARD_MODE_CRUISE = 3,
3528 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3529 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3530 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3531 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3532 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3533 MAV_STANDARD_MODE_MISSION = 6,
3534 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3535 MAV_STANDARD_MODE_LAND = 7,
3536 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3537 MAV_STANDARD_MODE_TAKEOFF = 8,
3538}
3539impl MavStandardMode {
3540 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3541}
3542impl Default for MavStandardMode {
3543 fn default() -> Self {
3544 Self::DEFAULT
3545 }
3546}
3547#[cfg_attr(feature = "ts", derive(TS))]
3548#[cfg_attr(feature = "ts", ts(export))]
3549#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3550#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3551#[cfg_attr(feature = "serde", serde(tag = "type"))]
3552#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3553#[repr(u32)]
3554pub enum MavState {
3555 #[doc = "Uninitialized system, state is unknown."]
3556 MAV_STATE_UNINIT = 0,
3557 #[doc = "System is booting up."]
3558 MAV_STATE_BOOT = 1,
3559 #[doc = "System is calibrating and not flight-ready."]
3560 MAV_STATE_CALIBRATING = 2,
3561 #[doc = "System is grounded and on standby. It can be launched any time."]
3562 MAV_STATE_STANDBY = 3,
3563 #[doc = "System is active and might be already airborne. Motors are engaged."]
3564 MAV_STATE_ACTIVE = 4,
3565 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3566 MAV_STATE_CRITICAL = 5,
3567 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3568 MAV_STATE_EMERGENCY = 6,
3569 #[doc = "System just initialized its power-down sequence, will shut down now."]
3570 MAV_STATE_POWEROFF = 7,
3571 #[doc = "System is terminating itself (failsafe or commanded)."]
3572 MAV_STATE_FLIGHT_TERMINATION = 8,
3573}
3574impl MavState {
3575 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3576}
3577impl Default for MavState {
3578 fn default() -> Self {
3579 Self::DEFAULT
3580 }
3581}
3582bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3583impl MavSysStatusSensor {
3584 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3585}
3586impl Default for MavSysStatusSensor {
3587 fn default() -> Self {
3588 Self::DEFAULT
3589 }
3590}
3591bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3592impl MavSysStatusSensorExtended {
3593 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3594}
3595impl Default for MavSysStatusSensorExtended {
3596 fn default() -> Self {
3597 Self::DEFAULT
3598 }
3599}
3600#[cfg_attr(feature = "ts", derive(TS))]
3601#[cfg_attr(feature = "ts", ts(export))]
3602#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3603#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3604#[cfg_attr(feature = "serde", serde(tag = "type"))]
3605#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3606#[repr(u32)]
3607pub enum MavTunnelPayloadType {
3608 #[doc = "Encoding of payload unknown."]
3609 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3610 #[doc = "Registered for STorM32 gimbal controller."]
3611 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3612 #[doc = "Registered for STorM32 gimbal controller."]
3613 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3614 #[doc = "Registered for STorM32 gimbal controller."]
3615 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3616 #[doc = "Registered for STorM32 gimbal controller."]
3617 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3618 #[doc = "Registered for STorM32 gimbal controller."]
3619 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3620 #[doc = "Registered for STorM32 gimbal controller."]
3621 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3622 #[doc = "Registered for STorM32 gimbal controller."]
3623 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3624 #[doc = "Registered for STorM32 gimbal controller."]
3625 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3626 #[doc = "Registered for STorM32 gimbal controller."]
3627 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3628 #[doc = "Registered for STorM32 gimbal controller."]
3629 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3630 #[doc = "Registered for ModalAI remote OSD protocol."]
3631 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3632 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3633 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3634 #[doc = "Registered for ModalAI vendor use."]
3635 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3636}
3637impl MavTunnelPayloadType {
3638 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3639}
3640impl Default for MavTunnelPayloadType {
3641 fn default() -> Self {
3642 Self::DEFAULT
3643 }
3644}
3645#[cfg_attr(feature = "ts", derive(TS))]
3646#[cfg_attr(feature = "ts", ts(export))]
3647#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3648#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3649#[cfg_attr(feature = "serde", serde(tag = "type"))]
3650#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3651#[repr(u32)]
3652#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3653pub enum MavType {
3654 #[doc = "Generic micro air vehicle"]
3655 MAV_TYPE_GENERIC = 0,
3656 #[doc = "Fixed wing aircraft."]
3657 MAV_TYPE_FIXED_WING = 1,
3658 #[doc = "Quadrotor"]
3659 MAV_TYPE_QUADROTOR = 2,
3660 #[doc = "Coaxial helicopter"]
3661 MAV_TYPE_COAXIAL = 3,
3662 #[doc = "Normal helicopter with tail rotor."]
3663 MAV_TYPE_HELICOPTER = 4,
3664 #[doc = "Ground installation"]
3665 MAV_TYPE_ANTENNA_TRACKER = 5,
3666 #[doc = "Operator control unit / ground control station"]
3667 MAV_TYPE_GCS = 6,
3668 #[doc = "Airship, controlled"]
3669 MAV_TYPE_AIRSHIP = 7,
3670 #[doc = "Free balloon, uncontrolled"]
3671 MAV_TYPE_FREE_BALLOON = 8,
3672 #[doc = "Rocket"]
3673 MAV_TYPE_ROCKET = 9,
3674 #[doc = "Ground rover"]
3675 MAV_TYPE_GROUND_ROVER = 10,
3676 #[doc = "Surface vessel, boat, ship"]
3677 MAV_TYPE_SURFACE_BOAT = 11,
3678 #[doc = "Submarine"]
3679 MAV_TYPE_SUBMARINE = 12,
3680 #[doc = "Hexarotor"]
3681 MAV_TYPE_HEXAROTOR = 13,
3682 #[doc = "Octorotor"]
3683 MAV_TYPE_OCTOROTOR = 14,
3684 #[doc = "Tricopter"]
3685 MAV_TYPE_TRICOPTER = 15,
3686 #[doc = "Flapping wing"]
3687 MAV_TYPE_FLAPPING_WING = 16,
3688 #[doc = "Kite"]
3689 MAV_TYPE_KITE = 17,
3690 #[doc = "Onboard companion controller"]
3691 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3692 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3693 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3694 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3695 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3696 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3697 MAV_TYPE_VTOL_TILTROTOR = 21,
3698 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3699 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3700 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3701 MAV_TYPE_VTOL_TAILSITTER = 23,
3702 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3703 MAV_TYPE_VTOL_TILTWING = 24,
3704 #[doc = "VTOL reserved 5"]
3705 MAV_TYPE_VTOL_RESERVED5 = 25,
3706 #[doc = "Gimbal"]
3707 MAV_TYPE_GIMBAL = 26,
3708 #[doc = "ADSB system"]
3709 MAV_TYPE_ADSB = 27,
3710 #[doc = "Steerable, nonrigid airfoil"]
3711 MAV_TYPE_PARAFOIL = 28,
3712 #[doc = "Dodecarotor"]
3713 MAV_TYPE_DODECAROTOR = 29,
3714 #[doc = "Camera"]
3715 MAV_TYPE_CAMERA = 30,
3716 #[doc = "Charging station"]
3717 MAV_TYPE_CHARGING_STATION = 31,
3718 #[doc = "FLARM collision avoidance system"]
3719 MAV_TYPE_FLARM = 32,
3720 #[doc = "Servo"]
3721 MAV_TYPE_SERVO = 33,
3722 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3723 MAV_TYPE_ODID = 34,
3724 #[doc = "Decarotor"]
3725 MAV_TYPE_DECAROTOR = 35,
3726 #[doc = "Battery"]
3727 MAV_TYPE_BATTERY = 36,
3728 #[doc = "Parachute"]
3729 MAV_TYPE_PARACHUTE = 37,
3730 #[doc = "Log"]
3731 MAV_TYPE_LOG = 38,
3732 #[doc = "OSD"]
3733 MAV_TYPE_OSD = 39,
3734 #[doc = "IMU"]
3735 MAV_TYPE_IMU = 40,
3736 #[doc = "GPS"]
3737 MAV_TYPE_GPS = 41,
3738 #[doc = "Winch"]
3739 MAV_TYPE_WINCH = 42,
3740 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3741 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3742 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3743 MAV_TYPE_ILLUMINATOR = 44,
3744 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3745 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3746}
3747impl MavType {
3748 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3749}
3750impl Default for MavType {
3751 fn default() -> Self {
3752 Self::DEFAULT
3753 }
3754}
3755#[cfg_attr(feature = "ts", derive(TS))]
3756#[cfg_attr(feature = "ts", ts(export))]
3757#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3758#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3759#[cfg_attr(feature = "serde", serde(tag = "type"))]
3760#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3761#[repr(u32)]
3762#[doc = "Enumeration of VTOL states"]
3763pub enum MavVtolState {
3764 #[doc = "MAV is not configured as VTOL"]
3765 MAV_VTOL_STATE_UNDEFINED = 0,
3766 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3767 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3768 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3769 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3770 #[doc = "VTOL is in multicopter state"]
3771 MAV_VTOL_STATE_MC = 3,
3772 #[doc = "VTOL is in fixed-wing state"]
3773 MAV_VTOL_STATE_FW = 4,
3774}
3775impl MavVtolState {
3776 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3777}
3778impl Default for MavVtolState {
3779 fn default() -> Self {
3780 Self::DEFAULT
3781 }
3782}
3783bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3784impl MavWinchStatusFlag {
3785 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3786}
3787impl Default for MavWinchStatusFlag {
3788 fn default() -> Self {
3789 Self::DEFAULT
3790 }
3791}
3792#[cfg_attr(feature = "ts", derive(TS))]
3793#[cfg_attr(feature = "ts", ts(export))]
3794#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3795#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3796#[cfg_attr(feature = "serde", serde(tag = "type"))]
3797#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3798#[repr(u32)]
3799pub enum MavlinkDataStreamType {
3800 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3801 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3802 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3803 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3804 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3805 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3806}
3807impl MavlinkDataStreamType {
3808 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3809}
3810impl Default for MavlinkDataStreamType {
3811 fn default() -> Self {
3812 Self::DEFAULT
3813 }
3814}
3815#[cfg_attr(feature = "ts", derive(TS))]
3816#[cfg_attr(feature = "ts", ts(export))]
3817#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3818#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3819#[cfg_attr(feature = "serde", serde(tag = "type"))]
3820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3821#[repr(u32)]
3822#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3823pub enum MissionState {
3824 #[doc = "The mission status reporting is not supported."]
3825 MISSION_STATE_UNKNOWN = 0,
3826 #[doc = "No mission on the vehicle."]
3827 MISSION_STATE_NO_MISSION = 1,
3828 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3829 MISSION_STATE_NOT_STARTED = 2,
3830 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3831 MISSION_STATE_ACTIVE = 3,
3832 #[doc = "Mission is paused when in auto mode."]
3833 MISSION_STATE_PAUSED = 4,
3834 #[doc = "Mission has executed all mission items."]
3835 MISSION_STATE_COMPLETE = 5,
3836}
3837impl MissionState {
3838 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3839}
3840impl Default for MissionState {
3841 fn default() -> Self {
3842 Self::DEFAULT
3843 }
3844}
3845#[cfg_attr(feature = "ts", derive(TS))]
3846#[cfg_attr(feature = "ts", ts(export))]
3847#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3848#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3849#[cfg_attr(feature = "serde", serde(tag = "type"))]
3850#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3851#[repr(u32)]
3852#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3853pub enum MotorTestOrder {
3854 #[doc = "Default autopilot motor test method."]
3855 MOTOR_TEST_ORDER_DEFAULT = 0,
3856 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3857 MOTOR_TEST_ORDER_SEQUENCE = 1,
3858 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3859 MOTOR_TEST_ORDER_BOARD = 2,
3860}
3861impl MotorTestOrder {
3862 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3863}
3864impl Default for MotorTestOrder {
3865 fn default() -> Self {
3866 Self::DEFAULT
3867 }
3868}
3869#[cfg_attr(feature = "ts", derive(TS))]
3870#[cfg_attr(feature = "ts", ts(export))]
3871#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3872#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3873#[cfg_attr(feature = "serde", serde(tag = "type"))]
3874#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3875#[repr(u32)]
3876#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3877pub enum MotorTestThrottleType {
3878 #[doc = "Throttle as a percentage (0 ~ 100)"]
3879 MOTOR_TEST_THROTTLE_PERCENT = 0,
3880 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3881 MOTOR_TEST_THROTTLE_PWM = 1,
3882 #[doc = "Throttle pass-through from pilot's transmitter."]
3883 MOTOR_TEST_THROTTLE_PILOT = 2,
3884 #[doc = "Per-motor compass calibration test."]
3885 MOTOR_TEST_COMPASS_CAL = 3,
3886}
3887impl MotorTestThrottleType {
3888 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3889}
3890impl Default for MotorTestThrottleType {
3891 fn default() -> Self {
3892 Self::DEFAULT
3893 }
3894}
3895#[cfg_attr(feature = "ts", derive(TS))]
3896#[cfg_attr(feature = "ts", ts(export))]
3897#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3898#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3899#[cfg_attr(feature = "serde", serde(tag = "type"))]
3900#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3901#[repr(u32)]
3902pub enum NavVtolLandOptions {
3903 #[doc = "Default autopilot landing behaviour."]
3904 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3905 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3906 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3907 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3908 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3909}
3910impl NavVtolLandOptions {
3911 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3912}
3913impl Default for NavVtolLandOptions {
3914 fn default() -> Self {
3915 Self::DEFAULT
3916 }
3917}
3918#[cfg_attr(feature = "ts", derive(TS))]
3919#[cfg_attr(feature = "ts", ts(export))]
3920#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3921#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3922#[cfg_attr(feature = "serde", serde(tag = "type"))]
3923#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3924#[repr(u32)]
3925#[doc = "Yaw behaviour during orbit flight."]
3926pub enum OrbitYawBehaviour {
3927 #[doc = "Vehicle front points to the center (default)."]
3928 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3929 #[doc = "Vehicle front holds heading when message received."]
3930 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3931 #[doc = "Yaw uncontrolled."]
3932 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3933 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3934 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3935 #[doc = "Yaw controlled by RC input."]
3936 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3937 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3938 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3939}
3940impl OrbitYawBehaviour {
3941 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3942}
3943impl Default for OrbitYawBehaviour {
3944 fn default() -> Self {
3945 Self::DEFAULT
3946 }
3947}
3948#[cfg_attr(feature = "ts", derive(TS))]
3949#[cfg_attr(feature = "ts", ts(export))]
3950#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3951#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3952#[cfg_attr(feature = "serde", serde(tag = "type"))]
3953#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3954#[repr(u32)]
3955#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3956pub enum ParachuteAction {
3957 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3958 PARACHUTE_DISABLE = 0,
3959 #[doc = "Enable auto-release of parachute."]
3960 PARACHUTE_ENABLE = 1,
3961 #[doc = "Release parachute and kill motors."]
3962 PARACHUTE_RELEASE = 2,
3963}
3964impl ParachuteAction {
3965 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3966}
3967impl Default for ParachuteAction {
3968 fn default() -> Self {
3969 Self::DEFAULT
3970 }
3971}
3972#[cfg_attr(feature = "ts", derive(TS))]
3973#[cfg_attr(feature = "ts", ts(export))]
3974#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3975#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3976#[cfg_attr(feature = "serde", serde(tag = "type"))]
3977#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3978#[repr(u32)]
3979#[doc = "Result from PARAM_EXT_SET message."]
3980pub enum ParamAck {
3981 #[doc = "Parameter value ACCEPTED and SET"]
3982 PARAM_ACK_ACCEPTED = 0,
3983 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3984 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3985 #[doc = "Parameter failed to set"]
3986 PARAM_ACK_FAILED = 2,
3987 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3988 PARAM_ACK_IN_PROGRESS = 3,
3989}
3990impl ParamAck {
3991 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3992}
3993impl Default for ParamAck {
3994 fn default() -> Self {
3995 Self::DEFAULT
3996 }
3997}
3998bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3999impl PositionTargetTypemask {
4000 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
4001}
4002impl Default for PositionTargetTypemask {
4003 fn default() -> Self {
4004 Self::DEFAULT
4005 }
4006}
4007#[cfg_attr(feature = "ts", derive(TS))]
4008#[cfg_attr(feature = "ts", ts(export))]
4009#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4010#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4011#[cfg_attr(feature = "serde", serde(tag = "type"))]
4012#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4013#[repr(u32)]
4014#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
4015pub enum PrecisionLandMode {
4016 #[doc = "Normal (non-precision) landing."]
4017 PRECISION_LAND_MODE_DISABLED = 0,
4018 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
4019 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
4020 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
4021 PRECISION_LAND_MODE_REQUIRED = 2,
4022}
4023impl PrecisionLandMode {
4024 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
4025}
4026impl Default for PrecisionLandMode {
4027 fn default() -> Self {
4028 Self::DEFAULT
4029 }
4030}
4031#[cfg_attr(feature = "ts", derive(TS))]
4032#[cfg_attr(feature = "ts", ts(export))]
4033#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4034#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4035#[cfg_attr(feature = "serde", serde(tag = "type"))]
4036#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4037#[repr(u32)]
4038#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4039pub enum PreflightStorageMissionAction {
4040 #[doc = "Read current mission data from persistent storage"]
4041 MISSION_READ_PERSISTENT = 0,
4042 #[doc = "Write current mission data to persistent storage"]
4043 MISSION_WRITE_PERSISTENT = 1,
4044 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
4045 MISSION_RESET_DEFAULT = 2,
4046}
4047impl PreflightStorageMissionAction {
4048 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
4049}
4050impl Default for PreflightStorageMissionAction {
4051 fn default() -> Self {
4052 Self::DEFAULT
4053 }
4054}
4055#[cfg_attr(feature = "ts", derive(TS))]
4056#[cfg_attr(feature = "ts", ts(export))]
4057#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4058#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4059#[cfg_attr(feature = "serde", serde(tag = "type"))]
4060#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4061#[repr(u32)]
4062#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4063pub enum PreflightStorageParameterAction {
4064 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
4065 PARAM_READ_PERSISTENT = 0,
4066 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
4067 PARAM_WRITE_PERSISTENT = 1,
4068 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
4069 PARAM_RESET_CONFIG_DEFAULT = 2,
4070 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
4071 PARAM_RESET_SENSOR_DEFAULT = 3,
4072 #[doc = "Reset all parameters, including operation counters, to default values"]
4073 PARAM_RESET_ALL_DEFAULT = 4,
4074}
4075impl PreflightStorageParameterAction {
4076 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
4077}
4078impl Default for PreflightStorageParameterAction {
4079 fn default() -> Self {
4080 Self::DEFAULT
4081 }
4082}
4083#[cfg_attr(feature = "ts", derive(TS))]
4084#[cfg_attr(feature = "ts", ts(export))]
4085#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4086#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4087#[cfg_attr(feature = "serde", serde(tag = "type"))]
4088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4089#[repr(u32)]
4090#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
4091pub enum RcSubType {
4092 #[doc = "Spektrum DSM2"]
4093 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
4094 #[doc = "Spektrum DSMX"]
4095 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
4096 #[doc = "Spektrum DSMX8"]
4097 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
4098}
4099impl RcSubType {
4100 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
4101}
4102impl Default for RcSubType {
4103 fn default() -> Self {
4104 Self::DEFAULT
4105 }
4106}
4107#[cfg_attr(feature = "ts", derive(TS))]
4108#[cfg_attr(feature = "ts", ts(export))]
4109#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4110#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4111#[cfg_attr(feature = "serde", serde(tag = "type"))]
4112#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4113#[repr(u32)]
4114#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
4115pub enum RcType {
4116 #[doc = "Spektrum"]
4117 RC_TYPE_SPEKTRUM = 0,
4118 #[doc = "CRSF"]
4119 RC_TYPE_CRSF = 1,
4120}
4121impl RcType {
4122 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
4123}
4124impl Default for RcType {
4125 fn default() -> Self {
4126 Self::DEFAULT
4127 }
4128}
4129#[cfg_attr(feature = "ts", derive(TS))]
4130#[cfg_attr(feature = "ts", ts(export))]
4131#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4132#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4133#[cfg_attr(feature = "serde", serde(tag = "type"))]
4134#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4135#[repr(u32)]
4136#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
4137pub enum RebootShutdownConditions {
4138 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
4139 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
4140 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
4141 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
4142}
4143impl RebootShutdownConditions {
4144 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
4145}
4146impl Default for RebootShutdownConditions {
4147 fn default() -> Self {
4148 Self::DEFAULT
4149 }
4150}
4151#[cfg_attr(feature = "ts", derive(TS))]
4152#[cfg_attr(feature = "ts", ts(export))]
4153#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4155#[cfg_attr(feature = "serde", serde(tag = "type"))]
4156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4157#[repr(u32)]
4158#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
4159pub enum RtkBaselineCoordinateSystem {
4160 #[doc = "Earth-centered, Earth-fixed"]
4161 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
4162 #[doc = "RTK basestation centered, north, east, down"]
4163 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
4164}
4165impl RtkBaselineCoordinateSystem {
4166 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
4167}
4168impl Default for RtkBaselineCoordinateSystem {
4169 fn default() -> Self {
4170 Self::DEFAULT
4171 }
4172}
4173#[cfg_attr(feature = "ts", derive(TS))]
4174#[cfg_attr(feature = "ts", ts(export))]
4175#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4176#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4177#[cfg_attr(feature = "serde", serde(tag = "type"))]
4178#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4179#[repr(u32)]
4180#[doc = "Possible safety switch states."]
4181pub enum SafetySwitchState {
4182 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
4183 SAFETY_SWITCH_STATE_SAFE = 0,
4184 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
4185 SAFETY_SWITCH_STATE_DANGEROUS = 1,
4186}
4187impl SafetySwitchState {
4188 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
4189}
4190impl Default for SafetySwitchState {
4191 fn default() -> Self {
4192 Self::DEFAULT
4193 }
4194}
4195#[cfg_attr(feature = "ts", derive(TS))]
4196#[cfg_attr(feature = "ts", ts(export))]
4197#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4198#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4199#[cfg_attr(feature = "serde", serde(tag = "type"))]
4200#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4201#[repr(u32)]
4202#[doc = "SERIAL_CONTROL device types"]
4203pub enum SerialControlDev {
4204 #[doc = "First telemetry port"]
4205 SERIAL_CONTROL_DEV_TELEM1 = 0,
4206 #[doc = "Second telemetry port"]
4207 SERIAL_CONTROL_DEV_TELEM2 = 1,
4208 #[doc = "First GPS port"]
4209 SERIAL_CONTROL_DEV_GPS1 = 2,
4210 #[doc = "Second GPS port"]
4211 SERIAL_CONTROL_DEV_GPS2 = 3,
4212 #[doc = "system shell"]
4213 SERIAL_CONTROL_DEV_SHELL = 10,
4214 #[doc = "SERIAL0"]
4215 SERIAL_CONTROL_SERIAL0 = 100,
4216 #[doc = "SERIAL1"]
4217 SERIAL_CONTROL_SERIAL1 = 101,
4218 #[doc = "SERIAL2"]
4219 SERIAL_CONTROL_SERIAL2 = 102,
4220 #[doc = "SERIAL3"]
4221 SERIAL_CONTROL_SERIAL3 = 103,
4222 #[doc = "SERIAL4"]
4223 SERIAL_CONTROL_SERIAL4 = 104,
4224 #[doc = "SERIAL5"]
4225 SERIAL_CONTROL_SERIAL5 = 105,
4226 #[doc = "SERIAL6"]
4227 SERIAL_CONTROL_SERIAL6 = 106,
4228 #[doc = "SERIAL7"]
4229 SERIAL_CONTROL_SERIAL7 = 107,
4230 #[doc = "SERIAL8"]
4231 SERIAL_CONTROL_SERIAL8 = 108,
4232 #[doc = "SERIAL9"]
4233 SERIAL_CONTROL_SERIAL9 = 109,
4234}
4235impl SerialControlDev {
4236 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4237}
4238impl Default for SerialControlDev {
4239 fn default() -> Self {
4240 Self::DEFAULT
4241 }
4242}
4243bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4244impl SerialControlFlag {
4245 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4246}
4247impl Default for SerialControlFlag {
4248 fn default() -> Self {
4249 Self::DEFAULT
4250 }
4251}
4252#[cfg_attr(feature = "ts", derive(TS))]
4253#[cfg_attr(feature = "ts", ts(export))]
4254#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4256#[cfg_attr(feature = "serde", serde(tag = "type"))]
4257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4258#[repr(u32)]
4259#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4260pub enum SetFocusType {
4261 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4262 FOCUS_TYPE_STEP = 0,
4263 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4264 FOCUS_TYPE_CONTINUOUS = 1,
4265 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4266 FOCUS_TYPE_RANGE = 2,
4267 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4268 FOCUS_TYPE_METERS = 3,
4269 #[doc = "Focus automatically."]
4270 FOCUS_TYPE_AUTO = 4,
4271 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4272 FOCUS_TYPE_AUTO_SINGLE = 5,
4273 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4274 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4275}
4276impl SetFocusType {
4277 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4278}
4279impl Default for SetFocusType {
4280 fn default() -> Self {
4281 Self::DEFAULT
4282 }
4283}
4284#[cfg_attr(feature = "ts", derive(TS))]
4285#[cfg_attr(feature = "ts", ts(export))]
4286#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4287#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4288#[cfg_attr(feature = "serde", serde(tag = "type"))]
4289#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4290#[repr(u32)]
4291#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4292pub enum SpeedType {
4293 #[doc = "Airspeed"]
4294 SPEED_TYPE_AIRSPEED = 0,
4295 #[doc = "Groundspeed"]
4296 SPEED_TYPE_GROUNDSPEED = 1,
4297 #[doc = "Climb speed"]
4298 SPEED_TYPE_CLIMB_SPEED = 2,
4299 #[doc = "Descent speed"]
4300 SPEED_TYPE_DESCENT_SPEED = 3,
4301}
4302impl SpeedType {
4303 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4304}
4305impl Default for SpeedType {
4306 fn default() -> Self {
4307 Self::DEFAULT
4308 }
4309}
4310#[cfg_attr(feature = "ts", derive(TS))]
4311#[cfg_attr(feature = "ts", ts(export))]
4312#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4313#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4314#[cfg_attr(feature = "serde", serde(tag = "type"))]
4315#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4316#[repr(u32)]
4317#[doc = "Flags to indicate the status of camera storage."]
4318pub enum StorageStatus {
4319 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4320 STORAGE_STATUS_EMPTY = 0,
4321 #[doc = "Storage present but unformatted."]
4322 STORAGE_STATUS_UNFORMATTED = 1,
4323 #[doc = "Storage present and ready."]
4324 STORAGE_STATUS_READY = 2,
4325 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4326 STORAGE_STATUS_NOT_SUPPORTED = 3,
4327}
4328impl StorageStatus {
4329 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4330}
4331impl Default for StorageStatus {
4332 fn default() -> Self {
4333 Self::DEFAULT
4334 }
4335}
4336#[cfg_attr(feature = "ts", derive(TS))]
4337#[cfg_attr(feature = "ts", ts(export))]
4338#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4339#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4340#[cfg_attr(feature = "serde", serde(tag = "type"))]
4341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4342#[repr(u32)]
4343#[doc = "Flags to indicate the type of storage."]
4344pub enum StorageType {
4345 #[doc = "Storage type is not known."]
4346 STORAGE_TYPE_UNKNOWN = 0,
4347 #[doc = "Storage type is USB device."]
4348 STORAGE_TYPE_USB_STICK = 1,
4349 #[doc = "Storage type is SD card."]
4350 STORAGE_TYPE_SD = 2,
4351 #[doc = "Storage type is microSD card."]
4352 STORAGE_TYPE_MICROSD = 3,
4353 #[doc = "Storage type is CFast."]
4354 STORAGE_TYPE_CF = 4,
4355 #[doc = "Storage type is CFexpress."]
4356 STORAGE_TYPE_CFE = 5,
4357 #[doc = "Storage type is XQD."]
4358 STORAGE_TYPE_XQD = 6,
4359 #[doc = "Storage type is HD mass storage type."]
4360 STORAGE_TYPE_HD = 7,
4361 #[doc = "Storage type is other, not listed type."]
4362 STORAGE_TYPE_OTHER = 254,
4363}
4364impl StorageType {
4365 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4366}
4367impl Default for StorageType {
4368 fn default() -> Self {
4369 Self::DEFAULT
4370 }
4371}
4372bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4373impl StorageUsageFlag {
4374 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4375}
4376impl Default for StorageUsageFlag {
4377 fn default() -> Self {
4378 Self::DEFAULT
4379 }
4380}
4381#[cfg_attr(feature = "ts", derive(TS))]
4382#[cfg_attr(feature = "ts", ts(export))]
4383#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4384#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4385#[cfg_attr(feature = "serde", serde(tag = "type"))]
4386#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4387#[repr(u32)]
4388#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4389pub enum TuneFormat {
4390 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4391 TUNE_FORMAT_QBASIC1_1 = 1,
4392 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4393 TUNE_FORMAT_MML_MODERN = 2,
4394}
4395impl TuneFormat {
4396 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4397}
4398impl Default for TuneFormat {
4399 fn default() -> Self {
4400 Self::DEFAULT
4401 }
4402}
4403#[cfg_attr(feature = "ts", derive(TS))]
4404#[cfg_attr(feature = "ts", ts(export))]
4405#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4406#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4407#[cfg_attr(feature = "serde", serde(tag = "type"))]
4408#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4409#[repr(u32)]
4410#[doc = "Generalized UAVCAN node health"]
4411pub enum UavcanNodeHealth {
4412 #[doc = "The node is functioning properly."]
4413 UAVCAN_NODE_HEALTH_OK = 0,
4414 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4415 UAVCAN_NODE_HEALTH_WARNING = 1,
4416 #[doc = "The node has encountered a major failure."]
4417 UAVCAN_NODE_HEALTH_ERROR = 2,
4418 #[doc = "The node has suffered a fatal malfunction."]
4419 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4420}
4421impl UavcanNodeHealth {
4422 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4423}
4424impl Default for UavcanNodeHealth {
4425 fn default() -> Self {
4426 Self::DEFAULT
4427 }
4428}
4429#[cfg_attr(feature = "ts", derive(TS))]
4430#[cfg_attr(feature = "ts", ts(export))]
4431#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4432#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4433#[cfg_attr(feature = "serde", serde(tag = "type"))]
4434#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4435#[repr(u32)]
4436#[doc = "Generalized UAVCAN node mode"]
4437pub enum UavcanNodeMode {
4438 #[doc = "The node is performing its primary functions."]
4439 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4440 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4441 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4442 #[doc = "The node is under maintenance."]
4443 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4444 #[doc = "The node is in the process of updating its software."]
4445 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4446 #[doc = "The node is no longer available online."]
4447 UAVCAN_NODE_MODE_OFFLINE = 7,
4448}
4449impl UavcanNodeMode {
4450 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4451}
4452impl Default for UavcanNodeMode {
4453 fn default() -> Self {
4454 Self::DEFAULT
4455 }
4456}
4457bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4458impl UtmDataAvailFlags {
4459 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4460}
4461impl Default for UtmDataAvailFlags {
4462 fn default() -> Self {
4463 Self::DEFAULT
4464 }
4465}
4466#[cfg_attr(feature = "ts", derive(TS))]
4467#[cfg_attr(feature = "ts", ts(export))]
4468#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4469#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4470#[cfg_attr(feature = "serde", serde(tag = "type"))]
4471#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4472#[repr(u32)]
4473#[doc = "Airborne status of UAS."]
4474pub enum UtmFlightState {
4475 #[doc = "The flight state can't be determined."]
4476 UTM_FLIGHT_STATE_UNKNOWN = 1,
4477 #[doc = "UAS on ground."]
4478 UTM_FLIGHT_STATE_GROUND = 2,
4479 #[doc = "UAS airborne."]
4480 UTM_FLIGHT_STATE_AIRBORNE = 3,
4481 #[doc = "UAS is in an emergency flight state."]
4482 UTM_FLIGHT_STATE_EMERGENCY = 16,
4483 #[doc = "UAS has no active controls."]
4484 UTM_FLIGHT_STATE_NOCTRL = 32,
4485}
4486impl UtmFlightState {
4487 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4488}
4489impl Default for UtmFlightState {
4490 fn default() -> Self {
4491 Self::DEFAULT
4492 }
4493}
4494#[cfg_attr(feature = "ts", derive(TS))]
4495#[cfg_attr(feature = "ts", ts(export))]
4496#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4497#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4498#[cfg_attr(feature = "serde", serde(tag = "type"))]
4499#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4500#[repr(u32)]
4501#[doc = "Video stream encodings"]
4502pub enum VideoStreamEncoding {
4503 #[doc = "Stream encoding is unknown"]
4504 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4505 #[doc = "Stream encoding is H.264"]
4506 VIDEO_STREAM_ENCODING_H264 = 1,
4507 #[doc = "Stream encoding is H.265"]
4508 VIDEO_STREAM_ENCODING_H265 = 2,
4509}
4510impl VideoStreamEncoding {
4511 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4512}
4513impl Default for VideoStreamEncoding {
4514 fn default() -> Self {
4515 Self::DEFAULT
4516 }
4517}
4518bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4519impl VideoStreamStatusFlags {
4520 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4521}
4522impl Default for VideoStreamStatusFlags {
4523 fn default() -> Self {
4524 Self::DEFAULT
4525 }
4526}
4527#[cfg_attr(feature = "ts", derive(TS))]
4528#[cfg_attr(feature = "ts", ts(export))]
4529#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4531#[cfg_attr(feature = "serde", serde(tag = "type"))]
4532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4533#[repr(u32)]
4534#[doc = "Video stream types"]
4535pub enum VideoStreamType {
4536 #[doc = "Stream is RTSP"]
4537 VIDEO_STREAM_TYPE_RTSP = 0,
4538 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4539 VIDEO_STREAM_TYPE_RTPUDP = 1,
4540 #[doc = "Stream is MPEG on TCP"]
4541 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4542 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4543 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4544}
4545impl VideoStreamType {
4546 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4547}
4548impl Default for VideoStreamType {
4549 fn default() -> Self {
4550 Self::DEFAULT
4551 }
4552}
4553#[cfg_attr(feature = "ts", derive(TS))]
4554#[cfg_attr(feature = "ts", ts(export))]
4555#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4556#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4557#[cfg_attr(feature = "serde", serde(tag = "type"))]
4558#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4559#[repr(u32)]
4560#[doc = "Direction of VTOL transition"]
4561pub enum VtolTransitionHeading {
4562 #[doc = "Respect the heading configuration of the vehicle."]
4563 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4564 #[doc = "Use the heading pointing towards the next waypoint."]
4565 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4566 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4567 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4568 #[doc = "Use the specified heading in parameter 4."]
4569 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4570 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4571 VTOL_TRANSITION_HEADING_ANY = 4,
4572}
4573impl VtolTransitionHeading {
4574 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4575}
4576impl Default for VtolTransitionHeading {
4577 fn default() -> Self {
4578 Self::DEFAULT
4579 }
4580}
4581#[cfg_attr(feature = "ts", derive(TS))]
4582#[cfg_attr(feature = "ts", ts(export))]
4583#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4584#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4585#[cfg_attr(feature = "serde", serde(tag = "type"))]
4586#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4587#[repr(u32)]
4588#[doc = "WiFi Mode."]
4589pub enum WifiConfigApMode {
4590 #[doc = "WiFi mode is undefined."]
4591 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4592 #[doc = "WiFi configured as an access point."]
4593 WIFI_CONFIG_AP_MODE_AP = 1,
4594 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4595 WIFI_CONFIG_AP_MODE_STATION = 2,
4596 #[doc = "WiFi disabled."]
4597 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4598}
4599impl WifiConfigApMode {
4600 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4601}
4602impl Default for WifiConfigApMode {
4603 fn default() -> Self {
4604 Self::DEFAULT
4605 }
4606}
4607#[cfg_attr(feature = "ts", derive(TS))]
4608#[cfg_attr(feature = "ts", ts(export))]
4609#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4610#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4611#[cfg_attr(feature = "serde", serde(tag = "type"))]
4612#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4613#[repr(u32)]
4614#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4615pub enum WifiConfigApResponse {
4616 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4617 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4618 #[doc = "Changes accepted."]
4619 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4620 #[doc = "Changes rejected."]
4621 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4622 #[doc = "Invalid Mode."]
4623 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4624 #[doc = "Invalid SSID."]
4625 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4626 #[doc = "Invalid Password."]
4627 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4628}
4629impl WifiConfigApResponse {
4630 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4631}
4632impl Default for WifiConfigApResponse {
4633 fn default() -> Self {
4634 Self::DEFAULT
4635 }
4636}
4637#[cfg_attr(feature = "ts", derive(TS))]
4638#[cfg_attr(feature = "ts", ts(export))]
4639#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4640#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4641#[cfg_attr(feature = "serde", serde(tag = "type"))]
4642#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4643#[repr(u32)]
4644#[doc = "Winch actions."]
4645pub enum WinchActions {
4646 #[doc = "Allow motor to freewheel."]
4647 WINCH_RELAXED = 0,
4648 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4649 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4650 #[doc = "Wind or unwind line at specified rate."]
4651 WINCH_RATE_CONTROL = 2,
4652 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4653 WINCH_LOCK = 3,
4654 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4655 WINCH_DELIVER = 4,
4656 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4657 WINCH_HOLD = 5,
4658 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4659 WINCH_RETRACT = 6,
4660 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4661 WINCH_LOAD_LINE = 7,
4662 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4663 WINCH_ABANDON_LINE = 8,
4664 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4665 WINCH_LOAD_PAYLOAD = 9,
4666}
4667impl WinchActions {
4668 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4669}
4670impl Default for WinchActions {
4671 fn default() -> Self {
4672 Self::DEFAULT
4673 }
4674}
4675#[doc = "Set the vehicle attitude and body angular rates."]
4676#[doc = ""]
4677#[doc = "ID: 140"]
4678#[derive(Debug, Clone, PartialEq)]
4679#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4680#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4681#[cfg_attr(feature = "ts", derive(TS))]
4682#[cfg_attr(feature = "ts", ts(export))]
4683pub struct ACTUATOR_CONTROL_TARGET_DATA {
4684 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4685 pub time_usec: u64,
4686 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4687 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4688 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4689 pub controls: [f32; 8],
4690 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4691 pub group_mlx: u8,
4692}
4693impl ACTUATOR_CONTROL_TARGET_DATA {
4694 pub const ENCODED_LEN: usize = 41usize;
4695 pub const DEFAULT: Self = Self {
4696 time_usec: 0_u64,
4697 controls: [0.0_f32; 8usize],
4698 group_mlx: 0_u8,
4699 };
4700 #[cfg(feature = "arbitrary")]
4701 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4702 use arbitrary::{Arbitrary, Unstructured};
4703 let mut buf = [0u8; 1024];
4704 rng.fill_bytes(&mut buf);
4705 let mut unstructured = Unstructured::new(&buf);
4706 Self::arbitrary(&mut unstructured).unwrap_or_default()
4707 }
4708}
4709impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4710 fn default() -> Self {
4711 Self::DEFAULT.clone()
4712 }
4713}
4714impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4715 type Message = MavMessage;
4716 const ID: u32 = 140u32;
4717 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4718 const EXTRA_CRC: u8 = 181u8;
4719 const ENCODED_LEN: usize = 41usize;
4720 fn deser(
4721 _version: MavlinkVersion,
4722 __input: &[u8],
4723 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4724 let avail_len = __input.len();
4725 let mut payload_buf = [0; Self::ENCODED_LEN];
4726 let mut buf = if avail_len < Self::ENCODED_LEN {
4727 payload_buf[0..avail_len].copy_from_slice(__input);
4728 Bytes::new(&payload_buf)
4729 } else {
4730 Bytes::new(__input)
4731 };
4732 let mut __struct = Self::default();
4733 __struct.time_usec = buf.get_u64_le();
4734 for v in &mut __struct.controls {
4735 let val = buf.get_f32_le();
4736 *v = val;
4737 }
4738 __struct.group_mlx = buf.get_u8();
4739 Ok(__struct)
4740 }
4741 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4742 let mut __tmp = BytesMut::new(bytes);
4743 #[allow(clippy::absurd_extreme_comparisons)]
4744 #[allow(unused_comparisons)]
4745 if __tmp.remaining() < Self::ENCODED_LEN {
4746 panic!(
4747 "buffer is too small (need {} bytes, but got {})",
4748 Self::ENCODED_LEN,
4749 __tmp.remaining(),
4750 )
4751 }
4752 __tmp.put_u64_le(self.time_usec);
4753 for val in &self.controls {
4754 __tmp.put_f32_le(*val);
4755 }
4756 __tmp.put_u8(self.group_mlx);
4757 if matches!(version, MavlinkVersion::V2) {
4758 let len = __tmp.len();
4759 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4760 } else {
4761 __tmp.len()
4762 }
4763 }
4764}
4765#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4766#[doc = ""]
4767#[doc = "ID: 375"]
4768#[derive(Debug, Clone, PartialEq)]
4769#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4770#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4771#[cfg_attr(feature = "ts", derive(TS))]
4772#[cfg_attr(feature = "ts", ts(export))]
4773pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4774 #[doc = "Timestamp (since system boot)."]
4775 pub time_usec: u64,
4776 #[doc = "Active outputs"]
4777 pub active: u32,
4778 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4779 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4780 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4781 pub actuator: [f32; 32],
4782}
4783impl ACTUATOR_OUTPUT_STATUS_DATA {
4784 pub const ENCODED_LEN: usize = 140usize;
4785 pub const DEFAULT: Self = Self {
4786 time_usec: 0_u64,
4787 active: 0_u32,
4788 actuator: [0.0_f32; 32usize],
4789 };
4790 #[cfg(feature = "arbitrary")]
4791 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4792 use arbitrary::{Arbitrary, Unstructured};
4793 let mut buf = [0u8; 1024];
4794 rng.fill_bytes(&mut buf);
4795 let mut unstructured = Unstructured::new(&buf);
4796 Self::arbitrary(&mut unstructured).unwrap_or_default()
4797 }
4798}
4799impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4800 fn default() -> Self {
4801 Self::DEFAULT.clone()
4802 }
4803}
4804impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4805 type Message = MavMessage;
4806 const ID: u32 = 375u32;
4807 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4808 const EXTRA_CRC: u8 = 251u8;
4809 const ENCODED_LEN: usize = 140usize;
4810 fn deser(
4811 _version: MavlinkVersion,
4812 __input: &[u8],
4813 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4814 let avail_len = __input.len();
4815 let mut payload_buf = [0; Self::ENCODED_LEN];
4816 let mut buf = if avail_len < Self::ENCODED_LEN {
4817 payload_buf[0..avail_len].copy_from_slice(__input);
4818 Bytes::new(&payload_buf)
4819 } else {
4820 Bytes::new(__input)
4821 };
4822 let mut __struct = Self::default();
4823 __struct.time_usec = buf.get_u64_le();
4824 __struct.active = buf.get_u32_le();
4825 for v in &mut __struct.actuator {
4826 let val = buf.get_f32_le();
4827 *v = val;
4828 }
4829 Ok(__struct)
4830 }
4831 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4832 let mut __tmp = BytesMut::new(bytes);
4833 #[allow(clippy::absurd_extreme_comparisons)]
4834 #[allow(unused_comparisons)]
4835 if __tmp.remaining() < Self::ENCODED_LEN {
4836 panic!(
4837 "buffer is too small (need {} bytes, but got {})",
4838 Self::ENCODED_LEN,
4839 __tmp.remaining(),
4840 )
4841 }
4842 __tmp.put_u64_le(self.time_usec);
4843 __tmp.put_u32_le(self.active);
4844 for val in &self.actuator {
4845 __tmp.put_f32_le(*val);
4846 }
4847 if matches!(version, MavlinkVersion::V2) {
4848 let len = __tmp.len();
4849 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4850 } else {
4851 __tmp.len()
4852 }
4853 }
4854}
4855#[doc = "The location and information of an ADSB vehicle."]
4856#[doc = ""]
4857#[doc = "ID: 246"]
4858#[derive(Debug, Clone, PartialEq)]
4859#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4860#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4861#[cfg_attr(feature = "ts", derive(TS))]
4862#[cfg_attr(feature = "ts", ts(export))]
4863pub struct ADSB_VEHICLE_DATA {
4864 #[doc = "ICAO address"]
4865 pub ICAO_address: u32,
4866 #[doc = "Latitude"]
4867 pub lat: i32,
4868 #[doc = "Longitude"]
4869 pub lon: i32,
4870 #[doc = "Altitude(ASL)"]
4871 pub altitude: i32,
4872 #[doc = "Course over ground"]
4873 pub heading: u16,
4874 #[doc = "The horizontal velocity"]
4875 pub hor_velocity: u16,
4876 #[doc = "The vertical velocity. Positive is up"]
4877 pub ver_velocity: i16,
4878 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4879 pub flags: AdsbFlags,
4880 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4881 pub squawk: u16,
4882 #[doc = "ADSB altitude type."]
4883 pub altitude_type: AdsbAltitudeType,
4884 #[doc = "The callsign, 8+null"]
4885 #[cfg_attr(feature = "ts", ts(type = "string"))]
4886 pub callsign: CharArray<9>,
4887 #[doc = "ADSB emitter type."]
4888 pub emitter_type: AdsbEmitterType,
4889 #[doc = "Time since last communication in seconds"]
4890 pub tslc: u8,
4891}
4892impl ADSB_VEHICLE_DATA {
4893 pub const ENCODED_LEN: usize = 38usize;
4894 pub const DEFAULT: Self = Self {
4895 ICAO_address: 0_u32,
4896 lat: 0_i32,
4897 lon: 0_i32,
4898 altitude: 0_i32,
4899 heading: 0_u16,
4900 hor_velocity: 0_u16,
4901 ver_velocity: 0_i16,
4902 flags: AdsbFlags::DEFAULT,
4903 squawk: 0_u16,
4904 altitude_type: AdsbAltitudeType::DEFAULT,
4905 callsign: CharArray::new([0_u8; 9usize]),
4906 emitter_type: AdsbEmitterType::DEFAULT,
4907 tslc: 0_u8,
4908 };
4909 #[cfg(feature = "arbitrary")]
4910 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4911 use arbitrary::{Arbitrary, Unstructured};
4912 let mut buf = [0u8; 1024];
4913 rng.fill_bytes(&mut buf);
4914 let mut unstructured = Unstructured::new(&buf);
4915 Self::arbitrary(&mut unstructured).unwrap_or_default()
4916 }
4917}
4918impl Default for ADSB_VEHICLE_DATA {
4919 fn default() -> Self {
4920 Self::DEFAULT.clone()
4921 }
4922}
4923impl MessageData for ADSB_VEHICLE_DATA {
4924 type Message = MavMessage;
4925 const ID: u32 = 246u32;
4926 const NAME: &'static str = "ADSB_VEHICLE";
4927 const EXTRA_CRC: u8 = 184u8;
4928 const ENCODED_LEN: usize = 38usize;
4929 fn deser(
4930 _version: MavlinkVersion,
4931 __input: &[u8],
4932 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4933 let avail_len = __input.len();
4934 let mut payload_buf = [0; Self::ENCODED_LEN];
4935 let mut buf = if avail_len < Self::ENCODED_LEN {
4936 payload_buf[0..avail_len].copy_from_slice(__input);
4937 Bytes::new(&payload_buf)
4938 } else {
4939 Bytes::new(__input)
4940 };
4941 let mut __struct = Self::default();
4942 __struct.ICAO_address = buf.get_u32_le();
4943 __struct.lat = buf.get_i32_le();
4944 __struct.lon = buf.get_i32_le();
4945 __struct.altitude = buf.get_i32_le();
4946 __struct.heading = buf.get_u16_le();
4947 __struct.hor_velocity = buf.get_u16_le();
4948 __struct.ver_velocity = buf.get_i16_le();
4949 let tmp = buf.get_u16_le();
4950 __struct.flags = AdsbFlags::from_bits(tmp as <AdsbFlags as Flags>::Bits).ok_or(
4951 ::mavlink_core::error::ParserError::InvalidFlag {
4952 flag_type: "AdsbFlags",
4953 value: tmp as u64,
4954 },
4955 )?;
4956 __struct.squawk = buf.get_u16_le();
4957 let tmp = buf.get_u8();
4958 __struct.altitude_type =
4959 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4960 enum_type: "AdsbAltitudeType",
4961 value: tmp as u64,
4962 })?;
4963 let mut tmp = [0_u8; 9usize];
4964 for v in &mut tmp {
4965 *v = buf.get_u8();
4966 }
4967 __struct.callsign = CharArray::new(tmp);
4968 let tmp = buf.get_u8();
4969 __struct.emitter_type =
4970 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4971 enum_type: "AdsbEmitterType",
4972 value: tmp as u64,
4973 })?;
4974 __struct.tslc = buf.get_u8();
4975 Ok(__struct)
4976 }
4977 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4978 let mut __tmp = BytesMut::new(bytes);
4979 #[allow(clippy::absurd_extreme_comparisons)]
4980 #[allow(unused_comparisons)]
4981 if __tmp.remaining() < Self::ENCODED_LEN {
4982 panic!(
4983 "buffer is too small (need {} bytes, but got {})",
4984 Self::ENCODED_LEN,
4985 __tmp.remaining(),
4986 )
4987 }
4988 __tmp.put_u32_le(self.ICAO_address);
4989 __tmp.put_i32_le(self.lat);
4990 __tmp.put_i32_le(self.lon);
4991 __tmp.put_i32_le(self.altitude);
4992 __tmp.put_u16_le(self.heading);
4993 __tmp.put_u16_le(self.hor_velocity);
4994 __tmp.put_i16_le(self.ver_velocity);
4995 __tmp.put_u16_le(self.flags.bits() as u16);
4996 __tmp.put_u16_le(self.squawk);
4997 __tmp.put_u8(self.altitude_type as u8);
4998 for val in &self.callsign {
4999 __tmp.put_u8(*val);
5000 }
5001 __tmp.put_u8(self.emitter_type as u8);
5002 __tmp.put_u8(self.tslc);
5003 if matches!(version, MavlinkVersion::V2) {
5004 let len = __tmp.len();
5005 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5006 } else {
5007 __tmp.len()
5008 }
5009 }
5010}
5011#[doc = "The location and information of an AIS vessel."]
5012#[doc = ""]
5013#[doc = "ID: 301"]
5014#[derive(Debug, Clone, PartialEq)]
5015#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5016#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5017#[cfg_attr(feature = "ts", derive(TS))]
5018#[cfg_attr(feature = "ts", ts(export))]
5019pub struct AIS_VESSEL_DATA {
5020 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
5021 pub MMSI: u32,
5022 #[doc = "Latitude"]
5023 pub lat: i32,
5024 #[doc = "Longitude"]
5025 pub lon: i32,
5026 #[doc = "Course over ground"]
5027 pub COG: u16,
5028 #[doc = "True heading"]
5029 pub heading: u16,
5030 #[doc = "Speed over ground"]
5031 pub velocity: u16,
5032 #[doc = "Distance from lat/lon location to bow"]
5033 pub dimension_bow: u16,
5034 #[doc = "Distance from lat/lon location to stern"]
5035 pub dimension_stern: u16,
5036 #[doc = "Time since last communication in seconds"]
5037 pub tslc: u16,
5038 #[doc = "Bitmask to indicate various statuses including valid data fields"]
5039 pub flags: AisFlags,
5040 #[doc = "Turn rate"]
5041 pub turn_rate: i8,
5042 #[doc = "Navigational status"]
5043 pub navigational_status: AisNavStatus,
5044 #[doc = "Type of vessels"]
5045 pub mavtype: AisType,
5046 #[doc = "Distance from lat/lon location to port side"]
5047 pub dimension_port: u8,
5048 #[doc = "Distance from lat/lon location to starboard side"]
5049 pub dimension_starboard: u8,
5050 #[doc = "The vessel callsign"]
5051 #[cfg_attr(feature = "ts", ts(type = "string"))]
5052 pub callsign: CharArray<7>,
5053 #[doc = "The vessel name"]
5054 #[cfg_attr(feature = "ts", ts(type = "string"))]
5055 pub name: CharArray<20>,
5056}
5057impl AIS_VESSEL_DATA {
5058 pub const ENCODED_LEN: usize = 58usize;
5059 pub const DEFAULT: Self = Self {
5060 MMSI: 0_u32,
5061 lat: 0_i32,
5062 lon: 0_i32,
5063 COG: 0_u16,
5064 heading: 0_u16,
5065 velocity: 0_u16,
5066 dimension_bow: 0_u16,
5067 dimension_stern: 0_u16,
5068 tslc: 0_u16,
5069 flags: AisFlags::DEFAULT,
5070 turn_rate: 0_i8,
5071 navigational_status: AisNavStatus::DEFAULT,
5072 mavtype: AisType::DEFAULT,
5073 dimension_port: 0_u8,
5074 dimension_starboard: 0_u8,
5075 callsign: CharArray::new([0_u8; 7usize]),
5076 name: CharArray::new([0_u8; 20usize]),
5077 };
5078 #[cfg(feature = "arbitrary")]
5079 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5080 use arbitrary::{Arbitrary, Unstructured};
5081 let mut buf = [0u8; 1024];
5082 rng.fill_bytes(&mut buf);
5083 let mut unstructured = Unstructured::new(&buf);
5084 Self::arbitrary(&mut unstructured).unwrap_or_default()
5085 }
5086}
5087impl Default for AIS_VESSEL_DATA {
5088 fn default() -> Self {
5089 Self::DEFAULT.clone()
5090 }
5091}
5092impl MessageData for AIS_VESSEL_DATA {
5093 type Message = MavMessage;
5094 const ID: u32 = 301u32;
5095 const NAME: &'static str = "AIS_VESSEL";
5096 const EXTRA_CRC: u8 = 243u8;
5097 const ENCODED_LEN: usize = 58usize;
5098 fn deser(
5099 _version: MavlinkVersion,
5100 __input: &[u8],
5101 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5102 let avail_len = __input.len();
5103 let mut payload_buf = [0; Self::ENCODED_LEN];
5104 let mut buf = if avail_len < Self::ENCODED_LEN {
5105 payload_buf[0..avail_len].copy_from_slice(__input);
5106 Bytes::new(&payload_buf)
5107 } else {
5108 Bytes::new(__input)
5109 };
5110 let mut __struct = Self::default();
5111 __struct.MMSI = buf.get_u32_le();
5112 __struct.lat = buf.get_i32_le();
5113 __struct.lon = buf.get_i32_le();
5114 __struct.COG = buf.get_u16_le();
5115 __struct.heading = buf.get_u16_le();
5116 __struct.velocity = buf.get_u16_le();
5117 __struct.dimension_bow = buf.get_u16_le();
5118 __struct.dimension_stern = buf.get_u16_le();
5119 __struct.tslc = buf.get_u16_le();
5120 let tmp = buf.get_u16_le();
5121 __struct.flags = AisFlags::from_bits(tmp as <AisFlags as Flags>::Bits).ok_or(
5122 ::mavlink_core::error::ParserError::InvalidFlag {
5123 flag_type: "AisFlags",
5124 value: tmp as u64,
5125 },
5126 )?;
5127 __struct.turn_rate = buf.get_i8();
5128 let tmp = buf.get_u8();
5129 __struct.navigational_status =
5130 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5131 enum_type: "AisNavStatus",
5132 value: tmp as u64,
5133 })?;
5134 let tmp = buf.get_u8();
5135 __struct.mavtype =
5136 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5137 enum_type: "AisType",
5138 value: tmp as u64,
5139 })?;
5140 __struct.dimension_port = buf.get_u8();
5141 __struct.dimension_starboard = buf.get_u8();
5142 let mut tmp = [0_u8; 7usize];
5143 for v in &mut tmp {
5144 *v = buf.get_u8();
5145 }
5146 __struct.callsign = CharArray::new(tmp);
5147 let mut tmp = [0_u8; 20usize];
5148 for v in &mut tmp {
5149 *v = buf.get_u8();
5150 }
5151 __struct.name = CharArray::new(tmp);
5152 Ok(__struct)
5153 }
5154 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5155 let mut __tmp = BytesMut::new(bytes);
5156 #[allow(clippy::absurd_extreme_comparisons)]
5157 #[allow(unused_comparisons)]
5158 if __tmp.remaining() < Self::ENCODED_LEN {
5159 panic!(
5160 "buffer is too small (need {} bytes, but got {})",
5161 Self::ENCODED_LEN,
5162 __tmp.remaining(),
5163 )
5164 }
5165 __tmp.put_u32_le(self.MMSI);
5166 __tmp.put_i32_le(self.lat);
5167 __tmp.put_i32_le(self.lon);
5168 __tmp.put_u16_le(self.COG);
5169 __tmp.put_u16_le(self.heading);
5170 __tmp.put_u16_le(self.velocity);
5171 __tmp.put_u16_le(self.dimension_bow);
5172 __tmp.put_u16_le(self.dimension_stern);
5173 __tmp.put_u16_le(self.tslc);
5174 __tmp.put_u16_le(self.flags.bits() as u16);
5175 __tmp.put_i8(self.turn_rate);
5176 __tmp.put_u8(self.navigational_status as u8);
5177 __tmp.put_u8(self.mavtype as u8);
5178 __tmp.put_u8(self.dimension_port);
5179 __tmp.put_u8(self.dimension_starboard);
5180 for val in &self.callsign {
5181 __tmp.put_u8(*val);
5182 }
5183 for val in &self.name {
5184 __tmp.put_u8(*val);
5185 }
5186 if matches!(version, MavlinkVersion::V2) {
5187 let len = __tmp.len();
5188 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5189 } else {
5190 __tmp.len()
5191 }
5192 }
5193}
5194#[doc = "The current system altitude."]
5195#[doc = ""]
5196#[doc = "ID: 141"]
5197#[derive(Debug, Clone, PartialEq)]
5198#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5199#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5200#[cfg_attr(feature = "ts", derive(TS))]
5201#[cfg_attr(feature = "ts", ts(export))]
5202pub struct ALTITUDE_DATA {
5203 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5204 pub time_usec: u64,
5205 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
5206 pub altitude_monotonic: f32,
5207 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
5208 pub altitude_amsl: f32,
5209 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
5210 pub altitude_local: f32,
5211 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
5212 pub altitude_relative: f32,
5213 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
5214 pub altitude_terrain: f32,
5215 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
5216 pub bottom_clearance: f32,
5217}
5218impl ALTITUDE_DATA {
5219 pub const ENCODED_LEN: usize = 32usize;
5220 pub const DEFAULT: Self = Self {
5221 time_usec: 0_u64,
5222 altitude_monotonic: 0.0_f32,
5223 altitude_amsl: 0.0_f32,
5224 altitude_local: 0.0_f32,
5225 altitude_relative: 0.0_f32,
5226 altitude_terrain: 0.0_f32,
5227 bottom_clearance: 0.0_f32,
5228 };
5229 #[cfg(feature = "arbitrary")]
5230 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5231 use arbitrary::{Arbitrary, Unstructured};
5232 let mut buf = [0u8; 1024];
5233 rng.fill_bytes(&mut buf);
5234 let mut unstructured = Unstructured::new(&buf);
5235 Self::arbitrary(&mut unstructured).unwrap_or_default()
5236 }
5237}
5238impl Default for ALTITUDE_DATA {
5239 fn default() -> Self {
5240 Self::DEFAULT.clone()
5241 }
5242}
5243impl MessageData for ALTITUDE_DATA {
5244 type Message = MavMessage;
5245 const ID: u32 = 141u32;
5246 const NAME: &'static str = "ALTITUDE";
5247 const EXTRA_CRC: u8 = 47u8;
5248 const ENCODED_LEN: usize = 32usize;
5249 fn deser(
5250 _version: MavlinkVersion,
5251 __input: &[u8],
5252 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5253 let avail_len = __input.len();
5254 let mut payload_buf = [0; Self::ENCODED_LEN];
5255 let mut buf = if avail_len < Self::ENCODED_LEN {
5256 payload_buf[0..avail_len].copy_from_slice(__input);
5257 Bytes::new(&payload_buf)
5258 } else {
5259 Bytes::new(__input)
5260 };
5261 let mut __struct = Self::default();
5262 __struct.time_usec = buf.get_u64_le();
5263 __struct.altitude_monotonic = buf.get_f32_le();
5264 __struct.altitude_amsl = buf.get_f32_le();
5265 __struct.altitude_local = buf.get_f32_le();
5266 __struct.altitude_relative = buf.get_f32_le();
5267 __struct.altitude_terrain = buf.get_f32_le();
5268 __struct.bottom_clearance = buf.get_f32_le();
5269 Ok(__struct)
5270 }
5271 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5272 let mut __tmp = BytesMut::new(bytes);
5273 #[allow(clippy::absurd_extreme_comparisons)]
5274 #[allow(unused_comparisons)]
5275 if __tmp.remaining() < Self::ENCODED_LEN {
5276 panic!(
5277 "buffer is too small (need {} bytes, but got {})",
5278 Self::ENCODED_LEN,
5279 __tmp.remaining(),
5280 )
5281 }
5282 __tmp.put_u64_le(self.time_usec);
5283 __tmp.put_f32_le(self.altitude_monotonic);
5284 __tmp.put_f32_le(self.altitude_amsl);
5285 __tmp.put_f32_le(self.altitude_local);
5286 __tmp.put_f32_le(self.altitude_relative);
5287 __tmp.put_f32_le(self.altitude_terrain);
5288 __tmp.put_f32_le(self.bottom_clearance);
5289 if matches!(version, MavlinkVersion::V2) {
5290 let len = __tmp.len();
5291 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5292 } else {
5293 __tmp.len()
5294 }
5295 }
5296}
5297#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5298#[doc = ""]
5299#[doc = "ID: 30"]
5300#[derive(Debug, Clone, PartialEq)]
5301#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5302#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5303#[cfg_attr(feature = "ts", derive(TS))]
5304#[cfg_attr(feature = "ts", ts(export))]
5305pub struct ATTITUDE_DATA {
5306 #[doc = "Timestamp (time since system boot)."]
5307 pub time_boot_ms: u32,
5308 #[doc = "Roll angle (-pi..+pi)"]
5309 pub roll: f32,
5310 #[doc = "Pitch angle (-pi..+pi)"]
5311 pub pitch: f32,
5312 #[doc = "Yaw angle (-pi..+pi)"]
5313 pub yaw: f32,
5314 #[doc = "Roll angular speed"]
5315 pub rollspeed: f32,
5316 #[doc = "Pitch angular speed"]
5317 pub pitchspeed: f32,
5318 #[doc = "Yaw angular speed"]
5319 pub yawspeed: f32,
5320}
5321impl ATTITUDE_DATA {
5322 pub const ENCODED_LEN: usize = 28usize;
5323 pub const DEFAULT: Self = Self {
5324 time_boot_ms: 0_u32,
5325 roll: 0.0_f32,
5326 pitch: 0.0_f32,
5327 yaw: 0.0_f32,
5328 rollspeed: 0.0_f32,
5329 pitchspeed: 0.0_f32,
5330 yawspeed: 0.0_f32,
5331 };
5332 #[cfg(feature = "arbitrary")]
5333 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5334 use arbitrary::{Arbitrary, Unstructured};
5335 let mut buf = [0u8; 1024];
5336 rng.fill_bytes(&mut buf);
5337 let mut unstructured = Unstructured::new(&buf);
5338 Self::arbitrary(&mut unstructured).unwrap_or_default()
5339 }
5340}
5341impl Default for ATTITUDE_DATA {
5342 fn default() -> Self {
5343 Self::DEFAULT.clone()
5344 }
5345}
5346impl MessageData for ATTITUDE_DATA {
5347 type Message = MavMessage;
5348 const ID: u32 = 30u32;
5349 const NAME: &'static str = "ATTITUDE";
5350 const EXTRA_CRC: u8 = 39u8;
5351 const ENCODED_LEN: usize = 28usize;
5352 fn deser(
5353 _version: MavlinkVersion,
5354 __input: &[u8],
5355 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5356 let avail_len = __input.len();
5357 let mut payload_buf = [0; Self::ENCODED_LEN];
5358 let mut buf = if avail_len < Self::ENCODED_LEN {
5359 payload_buf[0..avail_len].copy_from_slice(__input);
5360 Bytes::new(&payload_buf)
5361 } else {
5362 Bytes::new(__input)
5363 };
5364 let mut __struct = Self::default();
5365 __struct.time_boot_ms = buf.get_u32_le();
5366 __struct.roll = buf.get_f32_le();
5367 __struct.pitch = buf.get_f32_le();
5368 __struct.yaw = buf.get_f32_le();
5369 __struct.rollspeed = buf.get_f32_le();
5370 __struct.pitchspeed = buf.get_f32_le();
5371 __struct.yawspeed = buf.get_f32_le();
5372 Ok(__struct)
5373 }
5374 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5375 let mut __tmp = BytesMut::new(bytes);
5376 #[allow(clippy::absurd_extreme_comparisons)]
5377 #[allow(unused_comparisons)]
5378 if __tmp.remaining() < Self::ENCODED_LEN {
5379 panic!(
5380 "buffer is too small (need {} bytes, but got {})",
5381 Self::ENCODED_LEN,
5382 __tmp.remaining(),
5383 )
5384 }
5385 __tmp.put_u32_le(self.time_boot_ms);
5386 __tmp.put_f32_le(self.roll);
5387 __tmp.put_f32_le(self.pitch);
5388 __tmp.put_f32_le(self.yaw);
5389 __tmp.put_f32_le(self.rollspeed);
5390 __tmp.put_f32_le(self.pitchspeed);
5391 __tmp.put_f32_le(self.yawspeed);
5392 if matches!(version, MavlinkVersion::V2) {
5393 let len = __tmp.len();
5394 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5395 } else {
5396 __tmp.len()
5397 }
5398 }
5399}
5400#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5401#[doc = ""]
5402#[doc = "ID: 31"]
5403#[derive(Debug, Clone, PartialEq)]
5404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5405#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5406#[cfg_attr(feature = "ts", derive(TS))]
5407#[cfg_attr(feature = "ts", ts(export))]
5408pub struct ATTITUDE_QUATERNION_DATA {
5409 #[doc = "Timestamp (time since system boot)."]
5410 pub time_boot_ms: u32,
5411 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5412 pub q1: f32,
5413 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5414 pub q2: f32,
5415 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5416 pub q3: f32,
5417 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5418 pub q4: f32,
5419 #[doc = "Roll angular speed"]
5420 pub rollspeed: f32,
5421 #[doc = "Pitch angular speed"]
5422 pub pitchspeed: f32,
5423 #[doc = "Yaw angular speed"]
5424 pub yawspeed: f32,
5425 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5426 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5427 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5428 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5429 pub repr_offset_q: [f32; 4],
5430}
5431impl ATTITUDE_QUATERNION_DATA {
5432 pub const ENCODED_LEN: usize = 48usize;
5433 pub const DEFAULT: Self = Self {
5434 time_boot_ms: 0_u32,
5435 q1: 0.0_f32,
5436 q2: 0.0_f32,
5437 q3: 0.0_f32,
5438 q4: 0.0_f32,
5439 rollspeed: 0.0_f32,
5440 pitchspeed: 0.0_f32,
5441 yawspeed: 0.0_f32,
5442 repr_offset_q: [0.0_f32; 4usize],
5443 };
5444 #[cfg(feature = "arbitrary")]
5445 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5446 use arbitrary::{Arbitrary, Unstructured};
5447 let mut buf = [0u8; 1024];
5448 rng.fill_bytes(&mut buf);
5449 let mut unstructured = Unstructured::new(&buf);
5450 Self::arbitrary(&mut unstructured).unwrap_or_default()
5451 }
5452}
5453impl Default for ATTITUDE_QUATERNION_DATA {
5454 fn default() -> Self {
5455 Self::DEFAULT.clone()
5456 }
5457}
5458impl MessageData for ATTITUDE_QUATERNION_DATA {
5459 type Message = MavMessage;
5460 const ID: u32 = 31u32;
5461 const NAME: &'static str = "ATTITUDE_QUATERNION";
5462 const EXTRA_CRC: u8 = 246u8;
5463 const ENCODED_LEN: usize = 48usize;
5464 fn deser(
5465 _version: MavlinkVersion,
5466 __input: &[u8],
5467 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5468 let avail_len = __input.len();
5469 let mut payload_buf = [0; Self::ENCODED_LEN];
5470 let mut buf = if avail_len < Self::ENCODED_LEN {
5471 payload_buf[0..avail_len].copy_from_slice(__input);
5472 Bytes::new(&payload_buf)
5473 } else {
5474 Bytes::new(__input)
5475 };
5476 let mut __struct = Self::default();
5477 __struct.time_boot_ms = buf.get_u32_le();
5478 __struct.q1 = buf.get_f32_le();
5479 __struct.q2 = buf.get_f32_le();
5480 __struct.q3 = buf.get_f32_le();
5481 __struct.q4 = buf.get_f32_le();
5482 __struct.rollspeed = buf.get_f32_le();
5483 __struct.pitchspeed = buf.get_f32_le();
5484 __struct.yawspeed = buf.get_f32_le();
5485 for v in &mut __struct.repr_offset_q {
5486 let val = buf.get_f32_le();
5487 *v = val;
5488 }
5489 Ok(__struct)
5490 }
5491 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5492 let mut __tmp = BytesMut::new(bytes);
5493 #[allow(clippy::absurd_extreme_comparisons)]
5494 #[allow(unused_comparisons)]
5495 if __tmp.remaining() < Self::ENCODED_LEN {
5496 panic!(
5497 "buffer is too small (need {} bytes, but got {})",
5498 Self::ENCODED_LEN,
5499 __tmp.remaining(),
5500 )
5501 }
5502 __tmp.put_u32_le(self.time_boot_ms);
5503 __tmp.put_f32_le(self.q1);
5504 __tmp.put_f32_le(self.q2);
5505 __tmp.put_f32_le(self.q3);
5506 __tmp.put_f32_le(self.q4);
5507 __tmp.put_f32_le(self.rollspeed);
5508 __tmp.put_f32_le(self.pitchspeed);
5509 __tmp.put_f32_le(self.yawspeed);
5510 if matches!(version, MavlinkVersion::V2) {
5511 for val in &self.repr_offset_q {
5512 __tmp.put_f32_le(*val);
5513 }
5514 let len = __tmp.len();
5515 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5516 } else {
5517 __tmp.len()
5518 }
5519 }
5520}
5521#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5522#[doc = ""]
5523#[doc = "ID: 61"]
5524#[derive(Debug, Clone, PartialEq)]
5525#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5526#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5527#[cfg_attr(feature = "ts", derive(TS))]
5528#[cfg_attr(feature = "ts", ts(export))]
5529pub struct ATTITUDE_QUATERNION_COV_DATA {
5530 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5531 pub time_usec: u64,
5532 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5533 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5534 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5535 pub q: [f32; 4],
5536 #[doc = "Roll angular speed"]
5537 pub rollspeed: f32,
5538 #[doc = "Pitch angular speed"]
5539 pub pitchspeed: f32,
5540 #[doc = "Yaw angular speed"]
5541 pub yawspeed: f32,
5542 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5543 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5544 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5545 pub covariance: [f32; 9],
5546}
5547impl ATTITUDE_QUATERNION_COV_DATA {
5548 pub const ENCODED_LEN: usize = 72usize;
5549 pub const DEFAULT: Self = Self {
5550 time_usec: 0_u64,
5551 q: [0.0_f32; 4usize],
5552 rollspeed: 0.0_f32,
5553 pitchspeed: 0.0_f32,
5554 yawspeed: 0.0_f32,
5555 covariance: [0.0_f32; 9usize],
5556 };
5557 #[cfg(feature = "arbitrary")]
5558 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5559 use arbitrary::{Arbitrary, Unstructured};
5560 let mut buf = [0u8; 1024];
5561 rng.fill_bytes(&mut buf);
5562 let mut unstructured = Unstructured::new(&buf);
5563 Self::arbitrary(&mut unstructured).unwrap_or_default()
5564 }
5565}
5566impl Default for ATTITUDE_QUATERNION_COV_DATA {
5567 fn default() -> Self {
5568 Self::DEFAULT.clone()
5569 }
5570}
5571impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5572 type Message = MavMessage;
5573 const ID: u32 = 61u32;
5574 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5575 const EXTRA_CRC: u8 = 167u8;
5576 const ENCODED_LEN: usize = 72usize;
5577 fn deser(
5578 _version: MavlinkVersion,
5579 __input: &[u8],
5580 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5581 let avail_len = __input.len();
5582 let mut payload_buf = [0; Self::ENCODED_LEN];
5583 let mut buf = if avail_len < Self::ENCODED_LEN {
5584 payload_buf[0..avail_len].copy_from_slice(__input);
5585 Bytes::new(&payload_buf)
5586 } else {
5587 Bytes::new(__input)
5588 };
5589 let mut __struct = Self::default();
5590 __struct.time_usec = buf.get_u64_le();
5591 for v in &mut __struct.q {
5592 let val = buf.get_f32_le();
5593 *v = val;
5594 }
5595 __struct.rollspeed = buf.get_f32_le();
5596 __struct.pitchspeed = buf.get_f32_le();
5597 __struct.yawspeed = buf.get_f32_le();
5598 for v in &mut __struct.covariance {
5599 let val = buf.get_f32_le();
5600 *v = val;
5601 }
5602 Ok(__struct)
5603 }
5604 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5605 let mut __tmp = BytesMut::new(bytes);
5606 #[allow(clippy::absurd_extreme_comparisons)]
5607 #[allow(unused_comparisons)]
5608 if __tmp.remaining() < Self::ENCODED_LEN {
5609 panic!(
5610 "buffer is too small (need {} bytes, but got {})",
5611 Self::ENCODED_LEN,
5612 __tmp.remaining(),
5613 )
5614 }
5615 __tmp.put_u64_le(self.time_usec);
5616 for val in &self.q {
5617 __tmp.put_f32_le(*val);
5618 }
5619 __tmp.put_f32_le(self.rollspeed);
5620 __tmp.put_f32_le(self.pitchspeed);
5621 __tmp.put_f32_le(self.yawspeed);
5622 for val in &self.covariance {
5623 __tmp.put_f32_le(*val);
5624 }
5625 if matches!(version, MavlinkVersion::V2) {
5626 let len = __tmp.len();
5627 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5628 } else {
5629 __tmp.len()
5630 }
5631 }
5632}
5633#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5634#[doc = ""]
5635#[doc = "ID: 83"]
5636#[derive(Debug, Clone, PartialEq)]
5637#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5638#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5639#[cfg_attr(feature = "ts", derive(TS))]
5640#[cfg_attr(feature = "ts", ts(export))]
5641pub struct ATTITUDE_TARGET_DATA {
5642 #[doc = "Timestamp (time since system boot)."]
5643 pub time_boot_ms: u32,
5644 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5645 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5646 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5647 pub q: [f32; 4],
5648 #[doc = "Body roll rate"]
5649 pub body_roll_rate: f32,
5650 #[doc = "Body pitch rate"]
5651 pub body_pitch_rate: f32,
5652 #[doc = "Body yaw rate"]
5653 pub body_yaw_rate: f32,
5654 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5655 pub thrust: f32,
5656 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5657 pub type_mask: AttitudeTargetTypemask,
5658}
5659impl ATTITUDE_TARGET_DATA {
5660 pub const ENCODED_LEN: usize = 37usize;
5661 pub const DEFAULT: Self = Self {
5662 time_boot_ms: 0_u32,
5663 q: [0.0_f32; 4usize],
5664 body_roll_rate: 0.0_f32,
5665 body_pitch_rate: 0.0_f32,
5666 body_yaw_rate: 0.0_f32,
5667 thrust: 0.0_f32,
5668 type_mask: AttitudeTargetTypemask::DEFAULT,
5669 };
5670 #[cfg(feature = "arbitrary")]
5671 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5672 use arbitrary::{Arbitrary, Unstructured};
5673 let mut buf = [0u8; 1024];
5674 rng.fill_bytes(&mut buf);
5675 let mut unstructured = Unstructured::new(&buf);
5676 Self::arbitrary(&mut unstructured).unwrap_or_default()
5677 }
5678}
5679impl Default for ATTITUDE_TARGET_DATA {
5680 fn default() -> Self {
5681 Self::DEFAULT.clone()
5682 }
5683}
5684impl MessageData for ATTITUDE_TARGET_DATA {
5685 type Message = MavMessage;
5686 const ID: u32 = 83u32;
5687 const NAME: &'static str = "ATTITUDE_TARGET";
5688 const EXTRA_CRC: u8 = 22u8;
5689 const ENCODED_LEN: usize = 37usize;
5690 fn deser(
5691 _version: MavlinkVersion,
5692 __input: &[u8],
5693 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5694 let avail_len = __input.len();
5695 let mut payload_buf = [0; Self::ENCODED_LEN];
5696 let mut buf = if avail_len < Self::ENCODED_LEN {
5697 payload_buf[0..avail_len].copy_from_slice(__input);
5698 Bytes::new(&payload_buf)
5699 } else {
5700 Bytes::new(__input)
5701 };
5702 let mut __struct = Self::default();
5703 __struct.time_boot_ms = buf.get_u32_le();
5704 for v in &mut __struct.q {
5705 let val = buf.get_f32_le();
5706 *v = val;
5707 }
5708 __struct.body_roll_rate = buf.get_f32_le();
5709 __struct.body_pitch_rate = buf.get_f32_le();
5710 __struct.body_yaw_rate = buf.get_f32_le();
5711 __struct.thrust = buf.get_f32_le();
5712 let tmp = buf.get_u8();
5713 __struct.type_mask =
5714 AttitudeTargetTypemask::from_bits(tmp as <AttitudeTargetTypemask as Flags>::Bits)
5715 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5716 flag_type: "AttitudeTargetTypemask",
5717 value: tmp as u64,
5718 })?;
5719 Ok(__struct)
5720 }
5721 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5722 let mut __tmp = BytesMut::new(bytes);
5723 #[allow(clippy::absurd_extreme_comparisons)]
5724 #[allow(unused_comparisons)]
5725 if __tmp.remaining() < Self::ENCODED_LEN {
5726 panic!(
5727 "buffer is too small (need {} bytes, but got {})",
5728 Self::ENCODED_LEN,
5729 __tmp.remaining(),
5730 )
5731 }
5732 __tmp.put_u32_le(self.time_boot_ms);
5733 for val in &self.q {
5734 __tmp.put_f32_le(*val);
5735 }
5736 __tmp.put_f32_le(self.body_roll_rate);
5737 __tmp.put_f32_le(self.body_pitch_rate);
5738 __tmp.put_f32_le(self.body_yaw_rate);
5739 __tmp.put_f32_le(self.thrust);
5740 __tmp.put_u8(self.type_mask.bits() as u8);
5741 if matches!(version, MavlinkVersion::V2) {
5742 let len = __tmp.len();
5743 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5744 } else {
5745 __tmp.len()
5746 }
5747 }
5748}
5749#[doc = "Motion capture attitude and position."]
5750#[doc = ""]
5751#[doc = "ID: 138"]
5752#[derive(Debug, Clone, PartialEq)]
5753#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5754#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5755#[cfg_attr(feature = "ts", derive(TS))]
5756#[cfg_attr(feature = "ts", ts(export))]
5757pub struct ATT_POS_MOCAP_DATA {
5758 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5759 pub time_usec: u64,
5760 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5761 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5762 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5763 pub q: [f32; 4],
5764 #[doc = "X position (NED)"]
5765 pub x: f32,
5766 #[doc = "Y position (NED)"]
5767 pub y: f32,
5768 #[doc = "Z position (NED)"]
5769 pub z: f32,
5770 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
5771 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5772 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5773 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5774 pub covariance: [f32; 21],
5775}
5776impl ATT_POS_MOCAP_DATA {
5777 pub const ENCODED_LEN: usize = 120usize;
5778 pub const DEFAULT: Self = Self {
5779 time_usec: 0_u64,
5780 q: [0.0_f32; 4usize],
5781 x: 0.0_f32,
5782 y: 0.0_f32,
5783 z: 0.0_f32,
5784 covariance: [0.0_f32; 21usize],
5785 };
5786 #[cfg(feature = "arbitrary")]
5787 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5788 use arbitrary::{Arbitrary, Unstructured};
5789 let mut buf = [0u8; 1024];
5790 rng.fill_bytes(&mut buf);
5791 let mut unstructured = Unstructured::new(&buf);
5792 Self::arbitrary(&mut unstructured).unwrap_or_default()
5793 }
5794}
5795impl Default for ATT_POS_MOCAP_DATA {
5796 fn default() -> Self {
5797 Self::DEFAULT.clone()
5798 }
5799}
5800impl MessageData for ATT_POS_MOCAP_DATA {
5801 type Message = MavMessage;
5802 const ID: u32 = 138u32;
5803 const NAME: &'static str = "ATT_POS_MOCAP";
5804 const EXTRA_CRC: u8 = 109u8;
5805 const ENCODED_LEN: usize = 120usize;
5806 fn deser(
5807 _version: MavlinkVersion,
5808 __input: &[u8],
5809 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5810 let avail_len = __input.len();
5811 let mut payload_buf = [0; Self::ENCODED_LEN];
5812 let mut buf = if avail_len < Self::ENCODED_LEN {
5813 payload_buf[0..avail_len].copy_from_slice(__input);
5814 Bytes::new(&payload_buf)
5815 } else {
5816 Bytes::new(__input)
5817 };
5818 let mut __struct = Self::default();
5819 __struct.time_usec = buf.get_u64_le();
5820 for v in &mut __struct.q {
5821 let val = buf.get_f32_le();
5822 *v = val;
5823 }
5824 __struct.x = buf.get_f32_le();
5825 __struct.y = buf.get_f32_le();
5826 __struct.z = buf.get_f32_le();
5827 for v in &mut __struct.covariance {
5828 let val = buf.get_f32_le();
5829 *v = val;
5830 }
5831 Ok(__struct)
5832 }
5833 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5834 let mut __tmp = BytesMut::new(bytes);
5835 #[allow(clippy::absurd_extreme_comparisons)]
5836 #[allow(unused_comparisons)]
5837 if __tmp.remaining() < Self::ENCODED_LEN {
5838 panic!(
5839 "buffer is too small (need {} bytes, but got {})",
5840 Self::ENCODED_LEN,
5841 __tmp.remaining(),
5842 )
5843 }
5844 __tmp.put_u64_le(self.time_usec);
5845 for val in &self.q {
5846 __tmp.put_f32_le(*val);
5847 }
5848 __tmp.put_f32_le(self.x);
5849 __tmp.put_f32_le(self.y);
5850 __tmp.put_f32_le(self.z);
5851 if matches!(version, MavlinkVersion::V2) {
5852 for val in &self.covariance {
5853 __tmp.put_f32_le(*val);
5854 }
5855 let len = __tmp.len();
5856 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5857 } else {
5858 __tmp.len()
5859 }
5860 }
5861}
5862#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
5863#[doc = ""]
5864#[doc = "ID: 7"]
5865#[derive(Debug, Clone, PartialEq)]
5866#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5867#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5868#[cfg_attr(feature = "ts", derive(TS))]
5869#[cfg_attr(feature = "ts", ts(export))]
5870pub struct AUTH_KEY_DATA {
5871 #[doc = "key"]
5872 #[cfg_attr(feature = "ts", ts(type = "string"))]
5873 pub key: CharArray<32>,
5874}
5875impl AUTH_KEY_DATA {
5876 pub const ENCODED_LEN: usize = 32usize;
5877 pub const DEFAULT: Self = Self {
5878 key: CharArray::new([0_u8; 32usize]),
5879 };
5880 #[cfg(feature = "arbitrary")]
5881 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5882 use arbitrary::{Arbitrary, Unstructured};
5883 let mut buf = [0u8; 1024];
5884 rng.fill_bytes(&mut buf);
5885 let mut unstructured = Unstructured::new(&buf);
5886 Self::arbitrary(&mut unstructured).unwrap_or_default()
5887 }
5888}
5889impl Default for AUTH_KEY_DATA {
5890 fn default() -> Self {
5891 Self::DEFAULT.clone()
5892 }
5893}
5894impl MessageData for AUTH_KEY_DATA {
5895 type Message = MavMessage;
5896 const ID: u32 = 7u32;
5897 const NAME: &'static str = "AUTH_KEY";
5898 const EXTRA_CRC: u8 = 119u8;
5899 const ENCODED_LEN: usize = 32usize;
5900 fn deser(
5901 _version: MavlinkVersion,
5902 __input: &[u8],
5903 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5904 let avail_len = __input.len();
5905 let mut payload_buf = [0; Self::ENCODED_LEN];
5906 let mut buf = if avail_len < Self::ENCODED_LEN {
5907 payload_buf[0..avail_len].copy_from_slice(__input);
5908 Bytes::new(&payload_buf)
5909 } else {
5910 Bytes::new(__input)
5911 };
5912 let mut __struct = Self::default();
5913 let mut tmp = [0_u8; 32usize];
5914 for v in &mut tmp {
5915 *v = buf.get_u8();
5916 }
5917 __struct.key = CharArray::new(tmp);
5918 Ok(__struct)
5919 }
5920 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5921 let mut __tmp = BytesMut::new(bytes);
5922 #[allow(clippy::absurd_extreme_comparisons)]
5923 #[allow(unused_comparisons)]
5924 if __tmp.remaining() < Self::ENCODED_LEN {
5925 panic!(
5926 "buffer is too small (need {} bytes, but got {})",
5927 Self::ENCODED_LEN,
5928 __tmp.remaining(),
5929 )
5930 }
5931 for val in &self.key {
5932 __tmp.put_u8(*val);
5933 }
5934 if matches!(version, MavlinkVersion::V2) {
5935 let len = __tmp.len();
5936 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5937 } else {
5938 __tmp.len()
5939 }
5940 }
5941}
5942#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
5943#[doc = ""]
5944#[doc = "ID: 286"]
5945#[derive(Debug, Clone, PartialEq)]
5946#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5947#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5948#[cfg_attr(feature = "ts", derive(TS))]
5949#[cfg_attr(feature = "ts", ts(export))]
5950pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5951 #[doc = "Timestamp (time since system boot)."]
5952 pub time_boot_us: u64,
5953 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
5954 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5955 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5956 pub q: [f32; 4],
5957 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
5958 pub q_estimated_delay_us: u32,
5959 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
5960 pub vx: f32,
5961 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
5962 pub vy: f32,
5963 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
5964 pub vz: f32,
5965 #[doc = "Estimated delay of the speed data. 0 if unknown."]
5966 pub v_estimated_delay_us: u32,
5967 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
5968 pub feed_forward_angular_velocity_z: f32,
5969 #[doc = "Bitmap indicating which estimator outputs are valid."]
5970 pub estimator_status: EstimatorStatusFlags,
5971 #[doc = "System ID"]
5972 pub target_system: u8,
5973 #[doc = "Component ID"]
5974 pub target_component: u8,
5975 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
5976 pub landed_state: MavLandedState,
5977 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
5978 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5979 pub angular_velocity_z: f32,
5980}
5981impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5982 pub const ENCODED_LEN: usize = 57usize;
5983 pub const DEFAULT: Self = Self {
5984 time_boot_us: 0_u64,
5985 q: [0.0_f32; 4usize],
5986 q_estimated_delay_us: 0_u32,
5987 vx: 0.0_f32,
5988 vy: 0.0_f32,
5989 vz: 0.0_f32,
5990 v_estimated_delay_us: 0_u32,
5991 feed_forward_angular_velocity_z: 0.0_f32,
5992 estimator_status: EstimatorStatusFlags::DEFAULT,
5993 target_system: 0_u8,
5994 target_component: 0_u8,
5995 landed_state: MavLandedState::DEFAULT,
5996 angular_velocity_z: 0.0_f32,
5997 };
5998 #[cfg(feature = "arbitrary")]
5999 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6000 use arbitrary::{Arbitrary, Unstructured};
6001 let mut buf = [0u8; 1024];
6002 rng.fill_bytes(&mut buf);
6003 let mut unstructured = Unstructured::new(&buf);
6004 Self::arbitrary(&mut unstructured).unwrap_or_default()
6005 }
6006}
6007impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6008 fn default() -> Self {
6009 Self::DEFAULT.clone()
6010 }
6011}
6012impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6013 type Message = MavMessage;
6014 const ID: u32 = 286u32;
6015 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
6016 const EXTRA_CRC: u8 = 210u8;
6017 const ENCODED_LEN: usize = 57usize;
6018 fn deser(
6019 _version: MavlinkVersion,
6020 __input: &[u8],
6021 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6022 let avail_len = __input.len();
6023 let mut payload_buf = [0; Self::ENCODED_LEN];
6024 let mut buf = if avail_len < Self::ENCODED_LEN {
6025 payload_buf[0..avail_len].copy_from_slice(__input);
6026 Bytes::new(&payload_buf)
6027 } else {
6028 Bytes::new(__input)
6029 };
6030 let mut __struct = Self::default();
6031 __struct.time_boot_us = buf.get_u64_le();
6032 for v in &mut __struct.q {
6033 let val = buf.get_f32_le();
6034 *v = val;
6035 }
6036 __struct.q_estimated_delay_us = buf.get_u32_le();
6037 __struct.vx = buf.get_f32_le();
6038 __struct.vy = buf.get_f32_le();
6039 __struct.vz = buf.get_f32_le();
6040 __struct.v_estimated_delay_us = buf.get_u32_le();
6041 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
6042 let tmp = buf.get_u16_le();
6043 __struct.estimator_status = EstimatorStatusFlags::from_bits(
6044 tmp as <EstimatorStatusFlags as Flags>::Bits,
6045 )
6046 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6047 flag_type: "EstimatorStatusFlags",
6048 value: tmp as u64,
6049 })?;
6050 __struct.target_system = buf.get_u8();
6051 __struct.target_component = buf.get_u8();
6052 let tmp = buf.get_u8();
6053 __struct.landed_state =
6054 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6055 enum_type: "MavLandedState",
6056 value: tmp as u64,
6057 })?;
6058 __struct.angular_velocity_z = buf.get_f32_le();
6059 Ok(__struct)
6060 }
6061 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6062 let mut __tmp = BytesMut::new(bytes);
6063 #[allow(clippy::absurd_extreme_comparisons)]
6064 #[allow(unused_comparisons)]
6065 if __tmp.remaining() < Self::ENCODED_LEN {
6066 panic!(
6067 "buffer is too small (need {} bytes, but got {})",
6068 Self::ENCODED_LEN,
6069 __tmp.remaining(),
6070 )
6071 }
6072 __tmp.put_u64_le(self.time_boot_us);
6073 for val in &self.q {
6074 __tmp.put_f32_le(*val);
6075 }
6076 __tmp.put_u32_le(self.q_estimated_delay_us);
6077 __tmp.put_f32_le(self.vx);
6078 __tmp.put_f32_le(self.vy);
6079 __tmp.put_f32_le(self.vz);
6080 __tmp.put_u32_le(self.v_estimated_delay_us);
6081 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
6082 __tmp.put_u16_le(self.estimator_status.bits() as u16);
6083 __tmp.put_u8(self.target_system);
6084 __tmp.put_u8(self.target_component);
6085 __tmp.put_u8(self.landed_state as u8);
6086 if matches!(version, MavlinkVersion::V2) {
6087 __tmp.put_f32_le(self.angular_velocity_z);
6088 let len = __tmp.len();
6089 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6090 } else {
6091 __tmp.len()
6092 }
6093 }
6094}
6095#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
6096#[doc = ""]
6097#[doc = "ID: 148"]
6098#[derive(Debug, Clone, PartialEq)]
6099#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6100#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6101#[cfg_attr(feature = "ts", derive(TS))]
6102#[cfg_attr(feature = "ts", ts(export))]
6103pub struct AUTOPILOT_VERSION_DATA {
6104 #[doc = "Bitmap of capabilities"]
6105 pub capabilities: MavProtocolCapability,
6106 #[doc = "UID if provided by hardware (see uid2)"]
6107 pub uid: u64,
6108 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
6109 pub flight_sw_version: u32,
6110 #[doc = "Middleware version number"]
6111 pub middleware_sw_version: u32,
6112 #[doc = "Operating system version number"]
6113 pub os_sw_version: u32,
6114 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
6115 pub board_version: u32,
6116 #[doc = "ID of the board vendor"]
6117 pub vendor_id: u16,
6118 #[doc = "ID of the product"]
6119 pub product_id: u16,
6120 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6121 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6122 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6123 pub flight_custom_version: [u8; 8],
6124 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6125 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6126 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6127 pub middleware_custom_version: [u8; 8],
6128 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6129 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6130 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6131 pub os_custom_version: [u8; 8],
6132 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
6133 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6134 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6135 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6136 pub uid2: [u8; 18],
6137}
6138impl AUTOPILOT_VERSION_DATA {
6139 pub const ENCODED_LEN: usize = 78usize;
6140 pub const DEFAULT: Self = Self {
6141 capabilities: MavProtocolCapability::DEFAULT,
6142 uid: 0_u64,
6143 flight_sw_version: 0_u32,
6144 middleware_sw_version: 0_u32,
6145 os_sw_version: 0_u32,
6146 board_version: 0_u32,
6147 vendor_id: 0_u16,
6148 product_id: 0_u16,
6149 flight_custom_version: [0_u8; 8usize],
6150 middleware_custom_version: [0_u8; 8usize],
6151 os_custom_version: [0_u8; 8usize],
6152 uid2: [0_u8; 18usize],
6153 };
6154 #[cfg(feature = "arbitrary")]
6155 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6156 use arbitrary::{Arbitrary, Unstructured};
6157 let mut buf = [0u8; 1024];
6158 rng.fill_bytes(&mut buf);
6159 let mut unstructured = Unstructured::new(&buf);
6160 Self::arbitrary(&mut unstructured).unwrap_or_default()
6161 }
6162}
6163impl Default for AUTOPILOT_VERSION_DATA {
6164 fn default() -> Self {
6165 Self::DEFAULT.clone()
6166 }
6167}
6168impl MessageData for AUTOPILOT_VERSION_DATA {
6169 type Message = MavMessage;
6170 const ID: u32 = 148u32;
6171 const NAME: &'static str = "AUTOPILOT_VERSION";
6172 const EXTRA_CRC: u8 = 178u8;
6173 const ENCODED_LEN: usize = 78usize;
6174 fn deser(
6175 _version: MavlinkVersion,
6176 __input: &[u8],
6177 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6178 let avail_len = __input.len();
6179 let mut payload_buf = [0; Self::ENCODED_LEN];
6180 let mut buf = if avail_len < Self::ENCODED_LEN {
6181 payload_buf[0..avail_len].copy_from_slice(__input);
6182 Bytes::new(&payload_buf)
6183 } else {
6184 Bytes::new(__input)
6185 };
6186 let mut __struct = Self::default();
6187 let tmp = buf.get_u64_le();
6188 __struct.capabilities = MavProtocolCapability::from_bits(
6189 tmp as <MavProtocolCapability as Flags>::Bits,
6190 )
6191 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6192 flag_type: "MavProtocolCapability",
6193 value: tmp as u64,
6194 })?;
6195 __struct.uid = buf.get_u64_le();
6196 __struct.flight_sw_version = buf.get_u32_le();
6197 __struct.middleware_sw_version = buf.get_u32_le();
6198 __struct.os_sw_version = buf.get_u32_le();
6199 __struct.board_version = buf.get_u32_le();
6200 __struct.vendor_id = buf.get_u16_le();
6201 __struct.product_id = buf.get_u16_le();
6202 for v in &mut __struct.flight_custom_version {
6203 let val = buf.get_u8();
6204 *v = val;
6205 }
6206 for v in &mut __struct.middleware_custom_version {
6207 let val = buf.get_u8();
6208 *v = val;
6209 }
6210 for v in &mut __struct.os_custom_version {
6211 let val = buf.get_u8();
6212 *v = val;
6213 }
6214 for v in &mut __struct.uid2 {
6215 let val = buf.get_u8();
6216 *v = val;
6217 }
6218 Ok(__struct)
6219 }
6220 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6221 let mut __tmp = BytesMut::new(bytes);
6222 #[allow(clippy::absurd_extreme_comparisons)]
6223 #[allow(unused_comparisons)]
6224 if __tmp.remaining() < Self::ENCODED_LEN {
6225 panic!(
6226 "buffer is too small (need {} bytes, but got {})",
6227 Self::ENCODED_LEN,
6228 __tmp.remaining(),
6229 )
6230 }
6231 __tmp.put_u64_le(self.capabilities.bits() as u64);
6232 __tmp.put_u64_le(self.uid);
6233 __tmp.put_u32_le(self.flight_sw_version);
6234 __tmp.put_u32_le(self.middleware_sw_version);
6235 __tmp.put_u32_le(self.os_sw_version);
6236 __tmp.put_u32_le(self.board_version);
6237 __tmp.put_u16_le(self.vendor_id);
6238 __tmp.put_u16_le(self.product_id);
6239 for val in &self.flight_custom_version {
6240 __tmp.put_u8(*val);
6241 }
6242 for val in &self.middleware_custom_version {
6243 __tmp.put_u8(*val);
6244 }
6245 for val in &self.os_custom_version {
6246 __tmp.put_u8(*val);
6247 }
6248 if matches!(version, MavlinkVersion::V2) {
6249 for val in &self.uid2 {
6250 __tmp.put_u8(*val);
6251 }
6252 let len = __tmp.len();
6253 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6254 } else {
6255 __tmp.len()
6256 }
6257 }
6258}
6259#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
6260#[doc = ""]
6261#[doc = "ID: 435"]
6262#[derive(Debug, Clone, PartialEq)]
6263#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6264#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6265#[cfg_attr(feature = "ts", derive(TS))]
6266#[cfg_attr(feature = "ts", ts(export))]
6267pub struct AVAILABLE_MODES_DATA {
6268 #[doc = "A bitfield for use for autopilot-specific flags"]
6269 pub custom_mode: u32,
6270 #[doc = "Mode properties."]
6271 pub properties: MavModeProperty,
6272 #[doc = "The total number of available modes for the current vehicle type."]
6273 pub number_modes: u8,
6274 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
6275 pub mode_index: u8,
6276 #[doc = "Standard mode."]
6277 pub standard_mode: MavStandardMode,
6278 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6279 #[cfg_attr(feature = "ts", ts(type = "string"))]
6280 pub mode_name: CharArray<35>,
6281}
6282impl AVAILABLE_MODES_DATA {
6283 pub const ENCODED_LEN: usize = 46usize;
6284 pub const DEFAULT: Self = Self {
6285 custom_mode: 0_u32,
6286 properties: MavModeProperty::DEFAULT,
6287 number_modes: 0_u8,
6288 mode_index: 0_u8,
6289 standard_mode: MavStandardMode::DEFAULT,
6290 mode_name: CharArray::new([0_u8; 35usize]),
6291 };
6292 #[cfg(feature = "arbitrary")]
6293 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6294 use arbitrary::{Arbitrary, Unstructured};
6295 let mut buf = [0u8; 1024];
6296 rng.fill_bytes(&mut buf);
6297 let mut unstructured = Unstructured::new(&buf);
6298 Self::arbitrary(&mut unstructured).unwrap_or_default()
6299 }
6300}
6301impl Default for AVAILABLE_MODES_DATA {
6302 fn default() -> Self {
6303 Self::DEFAULT.clone()
6304 }
6305}
6306impl MessageData for AVAILABLE_MODES_DATA {
6307 type Message = MavMessage;
6308 const ID: u32 = 435u32;
6309 const NAME: &'static str = "AVAILABLE_MODES";
6310 const EXTRA_CRC: u8 = 134u8;
6311 const ENCODED_LEN: usize = 46usize;
6312 fn deser(
6313 _version: MavlinkVersion,
6314 __input: &[u8],
6315 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6316 let avail_len = __input.len();
6317 let mut payload_buf = [0; Self::ENCODED_LEN];
6318 let mut buf = if avail_len < Self::ENCODED_LEN {
6319 payload_buf[0..avail_len].copy_from_slice(__input);
6320 Bytes::new(&payload_buf)
6321 } else {
6322 Bytes::new(__input)
6323 };
6324 let mut __struct = Self::default();
6325 __struct.custom_mode = buf.get_u32_le();
6326 let tmp = buf.get_u32_le();
6327 __struct.properties = MavModeProperty::from_bits(tmp as <MavModeProperty as Flags>::Bits)
6328 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6329 flag_type: "MavModeProperty",
6330 value: tmp as u64,
6331 })?;
6332 __struct.number_modes = buf.get_u8();
6333 __struct.mode_index = buf.get_u8();
6334 let tmp = buf.get_u8();
6335 __struct.standard_mode =
6336 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6337 enum_type: "MavStandardMode",
6338 value: tmp as u64,
6339 })?;
6340 let mut tmp = [0_u8; 35usize];
6341 for v in &mut tmp {
6342 *v = buf.get_u8();
6343 }
6344 __struct.mode_name = CharArray::new(tmp);
6345 Ok(__struct)
6346 }
6347 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6348 let mut __tmp = BytesMut::new(bytes);
6349 #[allow(clippy::absurd_extreme_comparisons)]
6350 #[allow(unused_comparisons)]
6351 if __tmp.remaining() < Self::ENCODED_LEN {
6352 panic!(
6353 "buffer is too small (need {} bytes, but got {})",
6354 Self::ENCODED_LEN,
6355 __tmp.remaining(),
6356 )
6357 }
6358 __tmp.put_u32_le(self.custom_mode);
6359 __tmp.put_u32_le(self.properties.bits() as u32);
6360 __tmp.put_u8(self.number_modes);
6361 __tmp.put_u8(self.mode_index);
6362 __tmp.put_u8(self.standard_mode as u8);
6363 for val in &self.mode_name {
6364 __tmp.put_u8(*val);
6365 }
6366 if matches!(version, MavlinkVersion::V2) {
6367 let len = __tmp.len();
6368 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6369 } else {
6370 __tmp.len()
6371 }
6372 }
6373}
6374#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6375#[doc = ""]
6376#[doc = "ID: 437"]
6377#[derive(Debug, Clone, PartialEq)]
6378#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6379#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6380#[cfg_attr(feature = "ts", derive(TS))]
6381#[cfg_attr(feature = "ts", ts(export))]
6382pub struct AVAILABLE_MODES_MONITOR_DATA {
6383 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6384 pub seq: u8,
6385}
6386impl AVAILABLE_MODES_MONITOR_DATA {
6387 pub const ENCODED_LEN: usize = 1usize;
6388 pub const DEFAULT: Self = Self { seq: 0_u8 };
6389 #[cfg(feature = "arbitrary")]
6390 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6391 use arbitrary::{Arbitrary, Unstructured};
6392 let mut buf = [0u8; 1024];
6393 rng.fill_bytes(&mut buf);
6394 let mut unstructured = Unstructured::new(&buf);
6395 Self::arbitrary(&mut unstructured).unwrap_or_default()
6396 }
6397}
6398impl Default for AVAILABLE_MODES_MONITOR_DATA {
6399 fn default() -> Self {
6400 Self::DEFAULT.clone()
6401 }
6402}
6403impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6404 type Message = MavMessage;
6405 const ID: u32 = 437u32;
6406 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6407 const EXTRA_CRC: u8 = 30u8;
6408 const ENCODED_LEN: usize = 1usize;
6409 fn deser(
6410 _version: MavlinkVersion,
6411 __input: &[u8],
6412 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6413 let avail_len = __input.len();
6414 let mut payload_buf = [0; Self::ENCODED_LEN];
6415 let mut buf = if avail_len < Self::ENCODED_LEN {
6416 payload_buf[0..avail_len].copy_from_slice(__input);
6417 Bytes::new(&payload_buf)
6418 } else {
6419 Bytes::new(__input)
6420 };
6421 let mut __struct = Self::default();
6422 __struct.seq = buf.get_u8();
6423 Ok(__struct)
6424 }
6425 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6426 let mut __tmp = BytesMut::new(bytes);
6427 #[allow(clippy::absurd_extreme_comparisons)]
6428 #[allow(unused_comparisons)]
6429 if __tmp.remaining() < Self::ENCODED_LEN {
6430 panic!(
6431 "buffer is too small (need {} bytes, but got {})",
6432 Self::ENCODED_LEN,
6433 __tmp.remaining(),
6434 )
6435 }
6436 __tmp.put_u8(self.seq);
6437 if matches!(version, MavlinkVersion::V2) {
6438 let len = __tmp.len();
6439 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6440 } else {
6441 __tmp.len()
6442 }
6443 }
6444}
6445#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6446#[doc = ""]
6447#[doc = "ID: 372"]
6448#[derive(Debug, Clone, PartialEq)]
6449#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6450#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6451#[cfg_attr(feature = "ts", derive(TS))]
6452#[cfg_attr(feature = "ts", ts(export))]
6453pub struct BATTERY_INFO_DATA {
6454 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6455 pub discharge_minimum_voltage: f32,
6456 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6457 pub charging_minimum_voltage: f32,
6458 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6459 pub resting_minimum_voltage: f32,
6460 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6461 pub charging_maximum_voltage: f32,
6462 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6463 pub charging_maximum_current: f32,
6464 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6465 pub nominal_voltage: f32,
6466 #[doc = "Maximum pack discharge current. 0: field not provided."]
6467 pub discharge_maximum_current: f32,
6468 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6469 pub discharge_maximum_burst_current: f32,
6470 #[doc = "Fully charged design capacity. 0: field not provided."]
6471 pub design_capacity: f32,
6472 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6473 pub full_charge_capacity: f32,
6474 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6475 pub cycle_count: u16,
6476 #[doc = "Battery weight. 0: field not provided."]
6477 pub weight: u16,
6478 #[doc = "Battery ID"]
6479 pub id: u8,
6480 #[doc = "Function of the battery."]
6481 pub battery_function: MavBatteryFunction,
6482 #[doc = "Type (chemistry) of the battery."]
6483 pub mavtype: MavBatteryType,
6484 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6485 pub state_of_health: u8,
6486 #[doc = "Number of battery cells in series. 0: field not provided."]
6487 pub cells_in_series: u8,
6488 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6489 #[cfg_attr(feature = "ts", ts(type = "string"))]
6490 pub manufacture_date: CharArray<9>,
6491 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6492 #[cfg_attr(feature = "ts", ts(type = "string"))]
6493 pub serial_number: CharArray<32>,
6494 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6495 #[cfg_attr(feature = "ts", ts(type = "string"))]
6496 pub name: CharArray<50>,
6497}
6498impl BATTERY_INFO_DATA {
6499 pub const ENCODED_LEN: usize = 140usize;
6500 pub const DEFAULT: Self = Self {
6501 discharge_minimum_voltage: 0.0_f32,
6502 charging_minimum_voltage: 0.0_f32,
6503 resting_minimum_voltage: 0.0_f32,
6504 charging_maximum_voltage: 0.0_f32,
6505 charging_maximum_current: 0.0_f32,
6506 nominal_voltage: 0.0_f32,
6507 discharge_maximum_current: 0.0_f32,
6508 discharge_maximum_burst_current: 0.0_f32,
6509 design_capacity: 0.0_f32,
6510 full_charge_capacity: 0.0_f32,
6511 cycle_count: 0_u16,
6512 weight: 0_u16,
6513 id: 0_u8,
6514 battery_function: MavBatteryFunction::DEFAULT,
6515 mavtype: MavBatteryType::DEFAULT,
6516 state_of_health: 0_u8,
6517 cells_in_series: 0_u8,
6518 manufacture_date: CharArray::new([0_u8; 9usize]),
6519 serial_number: CharArray::new([0_u8; 32usize]),
6520 name: CharArray::new([0_u8; 50usize]),
6521 };
6522 #[cfg(feature = "arbitrary")]
6523 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6524 use arbitrary::{Arbitrary, Unstructured};
6525 let mut buf = [0u8; 1024];
6526 rng.fill_bytes(&mut buf);
6527 let mut unstructured = Unstructured::new(&buf);
6528 Self::arbitrary(&mut unstructured).unwrap_or_default()
6529 }
6530}
6531impl Default for BATTERY_INFO_DATA {
6532 fn default() -> Self {
6533 Self::DEFAULT.clone()
6534 }
6535}
6536impl MessageData for BATTERY_INFO_DATA {
6537 type Message = MavMessage;
6538 const ID: u32 = 372u32;
6539 const NAME: &'static str = "BATTERY_INFO";
6540 const EXTRA_CRC: u8 = 26u8;
6541 const ENCODED_LEN: usize = 140usize;
6542 fn deser(
6543 _version: MavlinkVersion,
6544 __input: &[u8],
6545 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6546 let avail_len = __input.len();
6547 let mut payload_buf = [0; Self::ENCODED_LEN];
6548 let mut buf = if avail_len < Self::ENCODED_LEN {
6549 payload_buf[0..avail_len].copy_from_slice(__input);
6550 Bytes::new(&payload_buf)
6551 } else {
6552 Bytes::new(__input)
6553 };
6554 let mut __struct = Self::default();
6555 __struct.discharge_minimum_voltage = buf.get_f32_le();
6556 __struct.charging_minimum_voltage = buf.get_f32_le();
6557 __struct.resting_minimum_voltage = buf.get_f32_le();
6558 __struct.charging_maximum_voltage = buf.get_f32_le();
6559 __struct.charging_maximum_current = buf.get_f32_le();
6560 __struct.nominal_voltage = buf.get_f32_le();
6561 __struct.discharge_maximum_current = buf.get_f32_le();
6562 __struct.discharge_maximum_burst_current = buf.get_f32_le();
6563 __struct.design_capacity = buf.get_f32_le();
6564 __struct.full_charge_capacity = buf.get_f32_le();
6565 __struct.cycle_count = buf.get_u16_le();
6566 __struct.weight = buf.get_u16_le();
6567 __struct.id = buf.get_u8();
6568 let tmp = buf.get_u8();
6569 __struct.battery_function =
6570 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6571 enum_type: "MavBatteryFunction",
6572 value: tmp as u64,
6573 })?;
6574 let tmp = buf.get_u8();
6575 __struct.mavtype =
6576 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6577 enum_type: "MavBatteryType",
6578 value: tmp as u64,
6579 })?;
6580 __struct.state_of_health = buf.get_u8();
6581 __struct.cells_in_series = buf.get_u8();
6582 let mut tmp = [0_u8; 9usize];
6583 for v in &mut tmp {
6584 *v = buf.get_u8();
6585 }
6586 __struct.manufacture_date = CharArray::new(tmp);
6587 let mut tmp = [0_u8; 32usize];
6588 for v in &mut tmp {
6589 *v = buf.get_u8();
6590 }
6591 __struct.serial_number = CharArray::new(tmp);
6592 let mut tmp = [0_u8; 50usize];
6593 for v in &mut tmp {
6594 *v = buf.get_u8();
6595 }
6596 __struct.name = CharArray::new(tmp);
6597 Ok(__struct)
6598 }
6599 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6600 let mut __tmp = BytesMut::new(bytes);
6601 #[allow(clippy::absurd_extreme_comparisons)]
6602 #[allow(unused_comparisons)]
6603 if __tmp.remaining() < Self::ENCODED_LEN {
6604 panic!(
6605 "buffer is too small (need {} bytes, but got {})",
6606 Self::ENCODED_LEN,
6607 __tmp.remaining(),
6608 )
6609 }
6610 __tmp.put_f32_le(self.discharge_minimum_voltage);
6611 __tmp.put_f32_le(self.charging_minimum_voltage);
6612 __tmp.put_f32_le(self.resting_minimum_voltage);
6613 __tmp.put_f32_le(self.charging_maximum_voltage);
6614 __tmp.put_f32_le(self.charging_maximum_current);
6615 __tmp.put_f32_le(self.nominal_voltage);
6616 __tmp.put_f32_le(self.discharge_maximum_current);
6617 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6618 __tmp.put_f32_le(self.design_capacity);
6619 __tmp.put_f32_le(self.full_charge_capacity);
6620 __tmp.put_u16_le(self.cycle_count);
6621 __tmp.put_u16_le(self.weight);
6622 __tmp.put_u8(self.id);
6623 __tmp.put_u8(self.battery_function as u8);
6624 __tmp.put_u8(self.mavtype as u8);
6625 __tmp.put_u8(self.state_of_health);
6626 __tmp.put_u8(self.cells_in_series);
6627 for val in &self.manufacture_date {
6628 __tmp.put_u8(*val);
6629 }
6630 for val in &self.serial_number {
6631 __tmp.put_u8(*val);
6632 }
6633 for val in &self.name {
6634 __tmp.put_u8(*val);
6635 }
6636 if matches!(version, MavlinkVersion::V2) {
6637 let len = __tmp.len();
6638 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6639 } else {
6640 __tmp.len()
6641 }
6642 }
6643}
6644#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6645#[doc = ""]
6646#[doc = "ID: 147"]
6647#[derive(Debug, Clone, PartialEq)]
6648#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6649#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6650#[cfg_attr(feature = "ts", derive(TS))]
6651#[cfg_attr(feature = "ts", ts(export))]
6652pub struct BATTERY_STATUS_DATA {
6653 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6654 pub current_consumed: i32,
6655 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6656 pub energy_consumed: i32,
6657 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6658 pub temperature: i16,
6659 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6660 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6661 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6662 pub voltages: [u16; 10],
6663 #[doc = "Battery current, -1: autopilot does not measure the current"]
6664 pub current_battery: i16,
6665 #[doc = "Battery ID"]
6666 pub id: u8,
6667 #[doc = "Function of the battery"]
6668 pub battery_function: MavBatteryFunction,
6669 #[doc = "Type (chemistry) of the battery"]
6670 pub mavtype: MavBatteryType,
6671 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6672 pub battery_remaining: i8,
6673 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6674 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6675 pub time_remaining: i32,
6676 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6677 #[cfg_attr(feature = "serde", serde(default))]
6678 pub charge_state: MavBatteryChargeState,
6679 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6680 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6681 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6682 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6683 pub voltages_ext: [u16; 4],
6684 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6685 #[cfg_attr(feature = "serde", serde(default))]
6686 pub mode: MavBatteryMode,
6687 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6688 #[cfg_attr(feature = "serde", serde(default))]
6689 pub fault_bitmask: MavBatteryFault,
6690}
6691impl BATTERY_STATUS_DATA {
6692 pub const ENCODED_LEN: usize = 54usize;
6693 pub const DEFAULT: Self = Self {
6694 current_consumed: 0_i32,
6695 energy_consumed: 0_i32,
6696 temperature: 0_i16,
6697 voltages: [0_u16; 10usize],
6698 current_battery: 0_i16,
6699 id: 0_u8,
6700 battery_function: MavBatteryFunction::DEFAULT,
6701 mavtype: MavBatteryType::DEFAULT,
6702 battery_remaining: 0_i8,
6703 time_remaining: 0_i32,
6704 charge_state: MavBatteryChargeState::DEFAULT,
6705 voltages_ext: [0_u16; 4usize],
6706 mode: MavBatteryMode::DEFAULT,
6707 fault_bitmask: MavBatteryFault::DEFAULT,
6708 };
6709 #[cfg(feature = "arbitrary")]
6710 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6711 use arbitrary::{Arbitrary, Unstructured};
6712 let mut buf = [0u8; 1024];
6713 rng.fill_bytes(&mut buf);
6714 let mut unstructured = Unstructured::new(&buf);
6715 Self::arbitrary(&mut unstructured).unwrap_or_default()
6716 }
6717}
6718impl Default for BATTERY_STATUS_DATA {
6719 fn default() -> Self {
6720 Self::DEFAULT.clone()
6721 }
6722}
6723impl MessageData for BATTERY_STATUS_DATA {
6724 type Message = MavMessage;
6725 const ID: u32 = 147u32;
6726 const NAME: &'static str = "BATTERY_STATUS";
6727 const EXTRA_CRC: u8 = 154u8;
6728 const ENCODED_LEN: usize = 54usize;
6729 fn deser(
6730 _version: MavlinkVersion,
6731 __input: &[u8],
6732 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6733 let avail_len = __input.len();
6734 let mut payload_buf = [0; Self::ENCODED_LEN];
6735 let mut buf = if avail_len < Self::ENCODED_LEN {
6736 payload_buf[0..avail_len].copy_from_slice(__input);
6737 Bytes::new(&payload_buf)
6738 } else {
6739 Bytes::new(__input)
6740 };
6741 let mut __struct = Self::default();
6742 __struct.current_consumed = buf.get_i32_le();
6743 __struct.energy_consumed = buf.get_i32_le();
6744 __struct.temperature = buf.get_i16_le();
6745 for v in &mut __struct.voltages {
6746 let val = buf.get_u16_le();
6747 *v = val;
6748 }
6749 __struct.current_battery = buf.get_i16_le();
6750 __struct.id = buf.get_u8();
6751 let tmp = buf.get_u8();
6752 __struct.battery_function =
6753 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6754 enum_type: "MavBatteryFunction",
6755 value: tmp as u64,
6756 })?;
6757 let tmp = buf.get_u8();
6758 __struct.mavtype =
6759 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6760 enum_type: "MavBatteryType",
6761 value: tmp as u64,
6762 })?;
6763 __struct.battery_remaining = buf.get_i8();
6764 __struct.time_remaining = buf.get_i32_le();
6765 let tmp = buf.get_u8();
6766 __struct.charge_state =
6767 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6768 enum_type: "MavBatteryChargeState",
6769 value: tmp as u64,
6770 })?;
6771 for v in &mut __struct.voltages_ext {
6772 let val = buf.get_u16_le();
6773 *v = val;
6774 }
6775 let tmp = buf.get_u8();
6776 __struct.mode =
6777 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6778 enum_type: "MavBatteryMode",
6779 value: tmp as u64,
6780 })?;
6781 let tmp = buf.get_u32_le();
6782 __struct.fault_bitmask = MavBatteryFault::from_bits(
6783 tmp as <MavBatteryFault as Flags>::Bits,
6784 )
6785 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6786 flag_type: "MavBatteryFault",
6787 value: tmp as u64,
6788 })?;
6789 Ok(__struct)
6790 }
6791 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6792 let mut __tmp = BytesMut::new(bytes);
6793 #[allow(clippy::absurd_extreme_comparisons)]
6794 #[allow(unused_comparisons)]
6795 if __tmp.remaining() < Self::ENCODED_LEN {
6796 panic!(
6797 "buffer is too small (need {} bytes, but got {})",
6798 Self::ENCODED_LEN,
6799 __tmp.remaining(),
6800 )
6801 }
6802 __tmp.put_i32_le(self.current_consumed);
6803 __tmp.put_i32_le(self.energy_consumed);
6804 __tmp.put_i16_le(self.temperature);
6805 for val in &self.voltages {
6806 __tmp.put_u16_le(*val);
6807 }
6808 __tmp.put_i16_le(self.current_battery);
6809 __tmp.put_u8(self.id);
6810 __tmp.put_u8(self.battery_function as u8);
6811 __tmp.put_u8(self.mavtype as u8);
6812 __tmp.put_i8(self.battery_remaining);
6813 if matches!(version, MavlinkVersion::V2) {
6814 __tmp.put_i32_le(self.time_remaining);
6815 __tmp.put_u8(self.charge_state as u8);
6816 for val in &self.voltages_ext {
6817 __tmp.put_u16_le(*val);
6818 }
6819 __tmp.put_u8(self.mode as u8);
6820 __tmp.put_u32_le(self.fault_bitmask.bits() as u32);
6821 let len = __tmp.len();
6822 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6823 } else {
6824 __tmp.len()
6825 }
6826 }
6827}
6828#[doc = "Report button state change."]
6829#[doc = ""]
6830#[doc = "ID: 257"]
6831#[derive(Debug, Clone, PartialEq)]
6832#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6833#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6834#[cfg_attr(feature = "ts", derive(TS))]
6835#[cfg_attr(feature = "ts", ts(export))]
6836pub struct BUTTON_CHANGE_DATA {
6837 #[doc = "Timestamp (time since system boot)."]
6838 pub time_boot_ms: u32,
6839 #[doc = "Time of last change of button state."]
6840 pub last_change_ms: u32,
6841 #[doc = "Bitmap for state of buttons."]
6842 pub state: u8,
6843}
6844impl BUTTON_CHANGE_DATA {
6845 pub const ENCODED_LEN: usize = 9usize;
6846 pub const DEFAULT: Self = Self {
6847 time_boot_ms: 0_u32,
6848 last_change_ms: 0_u32,
6849 state: 0_u8,
6850 };
6851 #[cfg(feature = "arbitrary")]
6852 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6853 use arbitrary::{Arbitrary, Unstructured};
6854 let mut buf = [0u8; 1024];
6855 rng.fill_bytes(&mut buf);
6856 let mut unstructured = Unstructured::new(&buf);
6857 Self::arbitrary(&mut unstructured).unwrap_or_default()
6858 }
6859}
6860impl Default for BUTTON_CHANGE_DATA {
6861 fn default() -> Self {
6862 Self::DEFAULT.clone()
6863 }
6864}
6865impl MessageData for BUTTON_CHANGE_DATA {
6866 type Message = MavMessage;
6867 const ID: u32 = 257u32;
6868 const NAME: &'static str = "BUTTON_CHANGE";
6869 const EXTRA_CRC: u8 = 131u8;
6870 const ENCODED_LEN: usize = 9usize;
6871 fn deser(
6872 _version: MavlinkVersion,
6873 __input: &[u8],
6874 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6875 let avail_len = __input.len();
6876 let mut payload_buf = [0; Self::ENCODED_LEN];
6877 let mut buf = if avail_len < Self::ENCODED_LEN {
6878 payload_buf[0..avail_len].copy_from_slice(__input);
6879 Bytes::new(&payload_buf)
6880 } else {
6881 Bytes::new(__input)
6882 };
6883 let mut __struct = Self::default();
6884 __struct.time_boot_ms = buf.get_u32_le();
6885 __struct.last_change_ms = buf.get_u32_le();
6886 __struct.state = buf.get_u8();
6887 Ok(__struct)
6888 }
6889 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6890 let mut __tmp = BytesMut::new(bytes);
6891 #[allow(clippy::absurd_extreme_comparisons)]
6892 #[allow(unused_comparisons)]
6893 if __tmp.remaining() < Self::ENCODED_LEN {
6894 panic!(
6895 "buffer is too small (need {} bytes, but got {})",
6896 Self::ENCODED_LEN,
6897 __tmp.remaining(),
6898 )
6899 }
6900 __tmp.put_u32_le(self.time_boot_ms);
6901 __tmp.put_u32_le(self.last_change_ms);
6902 __tmp.put_u8(self.state);
6903 if matches!(version, MavlinkVersion::V2) {
6904 let len = __tmp.len();
6905 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6906 } else {
6907 __tmp.len()
6908 }
6909 }
6910}
6911#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6912#[doc = ""]
6913#[doc = "ID: 262"]
6914#[derive(Debug, Clone, PartialEq)]
6915#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6916#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6917#[cfg_attr(feature = "ts", derive(TS))]
6918#[cfg_attr(feature = "ts", ts(export))]
6919pub struct CAMERA_CAPTURE_STATUS_DATA {
6920 #[doc = "Timestamp (time since system boot)."]
6921 pub time_boot_ms: u32,
6922 #[doc = "Image capture interval"]
6923 pub image_interval: f32,
6924 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
6925 pub recording_time_ms: u32,
6926 #[doc = "Available storage capacity."]
6927 pub available_capacity: f32,
6928 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
6929 pub image_status: u8,
6930 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
6931 pub video_status: u8,
6932 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
6933 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6934 pub image_count: i32,
6935 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
6936 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6937 pub camera_device_id: u8,
6938}
6939impl CAMERA_CAPTURE_STATUS_DATA {
6940 pub const ENCODED_LEN: usize = 23usize;
6941 pub const DEFAULT: Self = Self {
6942 time_boot_ms: 0_u32,
6943 image_interval: 0.0_f32,
6944 recording_time_ms: 0_u32,
6945 available_capacity: 0.0_f32,
6946 image_status: 0_u8,
6947 video_status: 0_u8,
6948 image_count: 0_i32,
6949 camera_device_id: 0_u8,
6950 };
6951 #[cfg(feature = "arbitrary")]
6952 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6953 use arbitrary::{Arbitrary, Unstructured};
6954 let mut buf = [0u8; 1024];
6955 rng.fill_bytes(&mut buf);
6956 let mut unstructured = Unstructured::new(&buf);
6957 Self::arbitrary(&mut unstructured).unwrap_or_default()
6958 }
6959}
6960impl Default for CAMERA_CAPTURE_STATUS_DATA {
6961 fn default() -> Self {
6962 Self::DEFAULT.clone()
6963 }
6964}
6965impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
6966 type Message = MavMessage;
6967 const ID: u32 = 262u32;
6968 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
6969 const EXTRA_CRC: u8 = 12u8;
6970 const ENCODED_LEN: usize = 23usize;
6971 fn deser(
6972 _version: MavlinkVersion,
6973 __input: &[u8],
6974 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6975 let avail_len = __input.len();
6976 let mut payload_buf = [0; Self::ENCODED_LEN];
6977 let mut buf = if avail_len < Self::ENCODED_LEN {
6978 payload_buf[0..avail_len].copy_from_slice(__input);
6979 Bytes::new(&payload_buf)
6980 } else {
6981 Bytes::new(__input)
6982 };
6983 let mut __struct = Self::default();
6984 __struct.time_boot_ms = buf.get_u32_le();
6985 __struct.image_interval = buf.get_f32_le();
6986 __struct.recording_time_ms = buf.get_u32_le();
6987 __struct.available_capacity = buf.get_f32_le();
6988 __struct.image_status = buf.get_u8();
6989 __struct.video_status = buf.get_u8();
6990 __struct.image_count = buf.get_i32_le();
6991 __struct.camera_device_id = buf.get_u8();
6992 Ok(__struct)
6993 }
6994 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6995 let mut __tmp = BytesMut::new(bytes);
6996 #[allow(clippy::absurd_extreme_comparisons)]
6997 #[allow(unused_comparisons)]
6998 if __tmp.remaining() < Self::ENCODED_LEN {
6999 panic!(
7000 "buffer is too small (need {} bytes, but got {})",
7001 Self::ENCODED_LEN,
7002 __tmp.remaining(),
7003 )
7004 }
7005 __tmp.put_u32_le(self.time_boot_ms);
7006 __tmp.put_f32_le(self.image_interval);
7007 __tmp.put_u32_le(self.recording_time_ms);
7008 __tmp.put_f32_le(self.available_capacity);
7009 __tmp.put_u8(self.image_status);
7010 __tmp.put_u8(self.video_status);
7011 if matches!(version, MavlinkVersion::V2) {
7012 __tmp.put_i32_le(self.image_count);
7013 __tmp.put_u8(self.camera_device_id);
7014 let len = __tmp.len();
7015 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7016 } else {
7017 __tmp.len()
7018 }
7019 }
7020}
7021#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7022#[doc = ""]
7023#[doc = "ID: 271"]
7024#[derive(Debug, Clone, PartialEq)]
7025#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7026#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7027#[cfg_attr(feature = "ts", derive(TS))]
7028#[cfg_attr(feature = "ts", ts(export))]
7029pub struct CAMERA_FOV_STATUS_DATA {
7030 #[doc = "Timestamp (time since system boot)."]
7031 pub time_boot_ms: u32,
7032 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
7033 pub lat_camera: i32,
7034 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
7035 pub lon_camera: i32,
7036 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
7037 pub alt_camera: i32,
7038 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7039 pub lat_image: i32,
7040 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7041 pub lon_image: i32,
7042 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7043 pub alt_image: i32,
7044 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7045 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7046 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7047 pub q: [f32; 4],
7048 #[doc = "Horizontal field of view (NaN if unknown)."]
7049 pub hfov: f32,
7050 #[doc = "Vertical field of view (NaN if unknown)."]
7051 pub vfov: f32,
7052 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7053 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7054 pub camera_device_id: u8,
7055}
7056impl CAMERA_FOV_STATUS_DATA {
7057 pub const ENCODED_LEN: usize = 53usize;
7058 pub const DEFAULT: Self = Self {
7059 time_boot_ms: 0_u32,
7060 lat_camera: 0_i32,
7061 lon_camera: 0_i32,
7062 alt_camera: 0_i32,
7063 lat_image: 0_i32,
7064 lon_image: 0_i32,
7065 alt_image: 0_i32,
7066 q: [0.0_f32; 4usize],
7067 hfov: 0.0_f32,
7068 vfov: 0.0_f32,
7069 camera_device_id: 0_u8,
7070 };
7071 #[cfg(feature = "arbitrary")]
7072 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7073 use arbitrary::{Arbitrary, Unstructured};
7074 let mut buf = [0u8; 1024];
7075 rng.fill_bytes(&mut buf);
7076 let mut unstructured = Unstructured::new(&buf);
7077 Self::arbitrary(&mut unstructured).unwrap_or_default()
7078 }
7079}
7080impl Default for CAMERA_FOV_STATUS_DATA {
7081 fn default() -> Self {
7082 Self::DEFAULT.clone()
7083 }
7084}
7085impl MessageData for CAMERA_FOV_STATUS_DATA {
7086 type Message = MavMessage;
7087 const ID: u32 = 271u32;
7088 const NAME: &'static str = "CAMERA_FOV_STATUS";
7089 const EXTRA_CRC: u8 = 22u8;
7090 const ENCODED_LEN: usize = 53usize;
7091 fn deser(
7092 _version: MavlinkVersion,
7093 __input: &[u8],
7094 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7095 let avail_len = __input.len();
7096 let mut payload_buf = [0; Self::ENCODED_LEN];
7097 let mut buf = if avail_len < Self::ENCODED_LEN {
7098 payload_buf[0..avail_len].copy_from_slice(__input);
7099 Bytes::new(&payload_buf)
7100 } else {
7101 Bytes::new(__input)
7102 };
7103 let mut __struct = Self::default();
7104 __struct.time_boot_ms = buf.get_u32_le();
7105 __struct.lat_camera = buf.get_i32_le();
7106 __struct.lon_camera = buf.get_i32_le();
7107 __struct.alt_camera = buf.get_i32_le();
7108 __struct.lat_image = buf.get_i32_le();
7109 __struct.lon_image = buf.get_i32_le();
7110 __struct.alt_image = buf.get_i32_le();
7111 for v in &mut __struct.q {
7112 let val = buf.get_f32_le();
7113 *v = val;
7114 }
7115 __struct.hfov = buf.get_f32_le();
7116 __struct.vfov = buf.get_f32_le();
7117 __struct.camera_device_id = buf.get_u8();
7118 Ok(__struct)
7119 }
7120 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7121 let mut __tmp = BytesMut::new(bytes);
7122 #[allow(clippy::absurd_extreme_comparisons)]
7123 #[allow(unused_comparisons)]
7124 if __tmp.remaining() < Self::ENCODED_LEN {
7125 panic!(
7126 "buffer is too small (need {} bytes, but got {})",
7127 Self::ENCODED_LEN,
7128 __tmp.remaining(),
7129 )
7130 }
7131 __tmp.put_u32_le(self.time_boot_ms);
7132 __tmp.put_i32_le(self.lat_camera);
7133 __tmp.put_i32_le(self.lon_camera);
7134 __tmp.put_i32_le(self.alt_camera);
7135 __tmp.put_i32_le(self.lat_image);
7136 __tmp.put_i32_le(self.lon_image);
7137 __tmp.put_i32_le(self.alt_image);
7138 for val in &self.q {
7139 __tmp.put_f32_le(*val);
7140 }
7141 __tmp.put_f32_le(self.hfov);
7142 __tmp.put_f32_le(self.vfov);
7143 if matches!(version, MavlinkVersion::V2) {
7144 __tmp.put_u8(self.camera_device_id);
7145 let len = __tmp.len();
7146 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7147 } else {
7148 __tmp.len()
7149 }
7150 }
7151}
7152#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
7153#[doc = ""]
7154#[doc = "ID: 263"]
7155#[derive(Debug, Clone, PartialEq)]
7156#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7157#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7158#[cfg_attr(feature = "ts", derive(TS))]
7159#[cfg_attr(feature = "ts", ts(export))]
7160pub struct CAMERA_IMAGE_CAPTURED_DATA {
7161 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
7162 pub time_utc: u64,
7163 #[doc = "Timestamp (time since system boot)."]
7164 pub time_boot_ms: u32,
7165 #[doc = "Latitude where image was taken"]
7166 pub lat: i32,
7167 #[doc = "Longitude where capture was taken"]
7168 pub lon: i32,
7169 #[doc = "Altitude (MSL) where image was taken"]
7170 pub alt: i32,
7171 #[doc = "Altitude above ground"]
7172 pub relative_alt: i32,
7173 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7174 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7175 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7176 pub q: [f32; 4],
7177 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
7178 pub image_index: i32,
7179 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
7180 pub camera_id: u8,
7181 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
7182 pub capture_result: i8,
7183 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
7184 #[cfg_attr(feature = "ts", ts(type = "string"))]
7185 pub file_url: CharArray<205>,
7186}
7187impl CAMERA_IMAGE_CAPTURED_DATA {
7188 pub const ENCODED_LEN: usize = 255usize;
7189 pub const DEFAULT: Self = Self {
7190 time_utc: 0_u64,
7191 time_boot_ms: 0_u32,
7192 lat: 0_i32,
7193 lon: 0_i32,
7194 alt: 0_i32,
7195 relative_alt: 0_i32,
7196 q: [0.0_f32; 4usize],
7197 image_index: 0_i32,
7198 camera_id: 0_u8,
7199 capture_result: 0_i8,
7200 file_url: CharArray::new([0_u8; 205usize]),
7201 };
7202 #[cfg(feature = "arbitrary")]
7203 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7204 use arbitrary::{Arbitrary, Unstructured};
7205 let mut buf = [0u8; 1024];
7206 rng.fill_bytes(&mut buf);
7207 let mut unstructured = Unstructured::new(&buf);
7208 Self::arbitrary(&mut unstructured).unwrap_or_default()
7209 }
7210}
7211impl Default for CAMERA_IMAGE_CAPTURED_DATA {
7212 fn default() -> Self {
7213 Self::DEFAULT.clone()
7214 }
7215}
7216impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
7217 type Message = MavMessage;
7218 const ID: u32 = 263u32;
7219 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
7220 const EXTRA_CRC: u8 = 133u8;
7221 const ENCODED_LEN: usize = 255usize;
7222 fn deser(
7223 _version: MavlinkVersion,
7224 __input: &[u8],
7225 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7226 let avail_len = __input.len();
7227 let mut payload_buf = [0; Self::ENCODED_LEN];
7228 let mut buf = if avail_len < Self::ENCODED_LEN {
7229 payload_buf[0..avail_len].copy_from_slice(__input);
7230 Bytes::new(&payload_buf)
7231 } else {
7232 Bytes::new(__input)
7233 };
7234 let mut __struct = Self::default();
7235 __struct.time_utc = buf.get_u64_le();
7236 __struct.time_boot_ms = buf.get_u32_le();
7237 __struct.lat = buf.get_i32_le();
7238 __struct.lon = buf.get_i32_le();
7239 __struct.alt = buf.get_i32_le();
7240 __struct.relative_alt = buf.get_i32_le();
7241 for v in &mut __struct.q {
7242 let val = buf.get_f32_le();
7243 *v = val;
7244 }
7245 __struct.image_index = buf.get_i32_le();
7246 __struct.camera_id = buf.get_u8();
7247 __struct.capture_result = buf.get_i8();
7248 let mut tmp = [0_u8; 205usize];
7249 for v in &mut tmp {
7250 *v = buf.get_u8();
7251 }
7252 __struct.file_url = CharArray::new(tmp);
7253 Ok(__struct)
7254 }
7255 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7256 let mut __tmp = BytesMut::new(bytes);
7257 #[allow(clippy::absurd_extreme_comparisons)]
7258 #[allow(unused_comparisons)]
7259 if __tmp.remaining() < Self::ENCODED_LEN {
7260 panic!(
7261 "buffer is too small (need {} bytes, but got {})",
7262 Self::ENCODED_LEN,
7263 __tmp.remaining(),
7264 )
7265 }
7266 __tmp.put_u64_le(self.time_utc);
7267 __tmp.put_u32_le(self.time_boot_ms);
7268 __tmp.put_i32_le(self.lat);
7269 __tmp.put_i32_le(self.lon);
7270 __tmp.put_i32_le(self.alt);
7271 __tmp.put_i32_le(self.relative_alt);
7272 for val in &self.q {
7273 __tmp.put_f32_le(*val);
7274 }
7275 __tmp.put_i32_le(self.image_index);
7276 __tmp.put_u8(self.camera_id);
7277 __tmp.put_i8(self.capture_result);
7278 for val in &self.file_url {
7279 __tmp.put_u8(*val);
7280 }
7281 if matches!(version, MavlinkVersion::V2) {
7282 let len = __tmp.len();
7283 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7284 } else {
7285 __tmp.len()
7286 }
7287 }
7288}
7289#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7290#[doc = ""]
7291#[doc = "ID: 259"]
7292#[derive(Debug, Clone, PartialEq)]
7293#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7294#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7295#[cfg_attr(feature = "ts", derive(TS))]
7296#[cfg_attr(feature = "ts", ts(export))]
7297pub struct CAMERA_INFORMATION_DATA {
7298 #[doc = "Timestamp (time since system boot)."]
7299 pub time_boot_ms: u32,
7300 #[doc = "0xff). Use 0 if not known."]
7301 pub firmware_version: u32,
7302 #[doc = "Focal length. Use NaN if not known."]
7303 pub focal_length: f32,
7304 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7305 pub sensor_size_h: f32,
7306 #[doc = "Image sensor size vertical. Use NaN if not known."]
7307 pub sensor_size_v: f32,
7308 #[doc = "Bitmap of camera capability flags."]
7309 pub flags: CameraCapFlags,
7310 #[doc = "Horizontal image resolution. Use 0 if not known."]
7311 pub resolution_h: u16,
7312 #[doc = "Vertical image resolution. Use 0 if not known."]
7313 pub resolution_v: u16,
7314 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7315 pub cam_definition_version: u16,
7316 #[doc = "Name of the camera vendor"]
7317 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7318 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7319 pub vendor_name: [u8; 32],
7320 #[doc = "Name of the camera model"]
7321 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7322 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7323 pub model_name: [u8; 32],
7324 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7325 pub lens_id: u8,
7326 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7327 #[cfg_attr(feature = "ts", ts(type = "string"))]
7328 pub cam_definition_uri: CharArray<140>,
7329 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7330 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7331 pub gimbal_device_id: u8,
7332 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7333 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7334 pub camera_device_id: u8,
7335}
7336impl CAMERA_INFORMATION_DATA {
7337 pub const ENCODED_LEN: usize = 237usize;
7338 pub const DEFAULT: Self = Self {
7339 time_boot_ms: 0_u32,
7340 firmware_version: 0_u32,
7341 focal_length: 0.0_f32,
7342 sensor_size_h: 0.0_f32,
7343 sensor_size_v: 0.0_f32,
7344 flags: CameraCapFlags::DEFAULT,
7345 resolution_h: 0_u16,
7346 resolution_v: 0_u16,
7347 cam_definition_version: 0_u16,
7348 vendor_name: [0_u8; 32usize],
7349 model_name: [0_u8; 32usize],
7350 lens_id: 0_u8,
7351 cam_definition_uri: CharArray::new([0_u8; 140usize]),
7352 gimbal_device_id: 0_u8,
7353 camera_device_id: 0_u8,
7354 };
7355 #[cfg(feature = "arbitrary")]
7356 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7357 use arbitrary::{Arbitrary, Unstructured};
7358 let mut buf = [0u8; 1024];
7359 rng.fill_bytes(&mut buf);
7360 let mut unstructured = Unstructured::new(&buf);
7361 Self::arbitrary(&mut unstructured).unwrap_or_default()
7362 }
7363}
7364impl Default for CAMERA_INFORMATION_DATA {
7365 fn default() -> Self {
7366 Self::DEFAULT.clone()
7367 }
7368}
7369impl MessageData for CAMERA_INFORMATION_DATA {
7370 type Message = MavMessage;
7371 const ID: u32 = 259u32;
7372 const NAME: &'static str = "CAMERA_INFORMATION";
7373 const EXTRA_CRC: u8 = 92u8;
7374 const ENCODED_LEN: usize = 237usize;
7375 fn deser(
7376 _version: MavlinkVersion,
7377 __input: &[u8],
7378 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7379 let avail_len = __input.len();
7380 let mut payload_buf = [0; Self::ENCODED_LEN];
7381 let mut buf = if avail_len < Self::ENCODED_LEN {
7382 payload_buf[0..avail_len].copy_from_slice(__input);
7383 Bytes::new(&payload_buf)
7384 } else {
7385 Bytes::new(__input)
7386 };
7387 let mut __struct = Self::default();
7388 __struct.time_boot_ms = buf.get_u32_le();
7389 __struct.firmware_version = buf.get_u32_le();
7390 __struct.focal_length = buf.get_f32_le();
7391 __struct.sensor_size_h = buf.get_f32_le();
7392 __struct.sensor_size_v = buf.get_f32_le();
7393 let tmp = buf.get_u32_le();
7394 __struct.flags = CameraCapFlags::from_bits(tmp as <CameraCapFlags as Flags>::Bits).ok_or(
7395 ::mavlink_core::error::ParserError::InvalidFlag {
7396 flag_type: "CameraCapFlags",
7397 value: tmp as u64,
7398 },
7399 )?;
7400 __struct.resolution_h = buf.get_u16_le();
7401 __struct.resolution_v = buf.get_u16_le();
7402 __struct.cam_definition_version = buf.get_u16_le();
7403 for v in &mut __struct.vendor_name {
7404 let val = buf.get_u8();
7405 *v = val;
7406 }
7407 for v in &mut __struct.model_name {
7408 let val = buf.get_u8();
7409 *v = val;
7410 }
7411 __struct.lens_id = buf.get_u8();
7412 let mut tmp = [0_u8; 140usize];
7413 for v in &mut tmp {
7414 *v = buf.get_u8();
7415 }
7416 __struct.cam_definition_uri = CharArray::new(tmp);
7417 __struct.gimbal_device_id = buf.get_u8();
7418 __struct.camera_device_id = buf.get_u8();
7419 Ok(__struct)
7420 }
7421 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7422 let mut __tmp = BytesMut::new(bytes);
7423 #[allow(clippy::absurd_extreme_comparisons)]
7424 #[allow(unused_comparisons)]
7425 if __tmp.remaining() < Self::ENCODED_LEN {
7426 panic!(
7427 "buffer is too small (need {} bytes, but got {})",
7428 Self::ENCODED_LEN,
7429 __tmp.remaining(),
7430 )
7431 }
7432 __tmp.put_u32_le(self.time_boot_ms);
7433 __tmp.put_u32_le(self.firmware_version);
7434 __tmp.put_f32_le(self.focal_length);
7435 __tmp.put_f32_le(self.sensor_size_h);
7436 __tmp.put_f32_le(self.sensor_size_v);
7437 __tmp.put_u32_le(self.flags.bits() as u32);
7438 __tmp.put_u16_le(self.resolution_h);
7439 __tmp.put_u16_le(self.resolution_v);
7440 __tmp.put_u16_le(self.cam_definition_version);
7441 for val in &self.vendor_name {
7442 __tmp.put_u8(*val);
7443 }
7444 for val in &self.model_name {
7445 __tmp.put_u8(*val);
7446 }
7447 __tmp.put_u8(self.lens_id);
7448 for val in &self.cam_definition_uri {
7449 __tmp.put_u8(*val);
7450 }
7451 if matches!(version, MavlinkVersion::V2) {
7452 __tmp.put_u8(self.gimbal_device_id);
7453 __tmp.put_u8(self.camera_device_id);
7454 let len = __tmp.len();
7455 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7456 } else {
7457 __tmp.len()
7458 }
7459 }
7460}
7461#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7462#[doc = ""]
7463#[doc = "ID: 260"]
7464#[derive(Debug, Clone, PartialEq)]
7465#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7466#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7467#[cfg_attr(feature = "ts", derive(TS))]
7468#[cfg_attr(feature = "ts", ts(export))]
7469pub struct CAMERA_SETTINGS_DATA {
7470 #[doc = "Timestamp (time since system boot)."]
7471 pub time_boot_ms: u32,
7472 #[doc = "Camera mode"]
7473 pub mode_id: CameraMode,
7474 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7475 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7476 pub zoomLevel: f32,
7477 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7478 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7479 pub focusLevel: f32,
7480 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7481 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7482 pub camera_device_id: u8,
7483}
7484impl CAMERA_SETTINGS_DATA {
7485 pub const ENCODED_LEN: usize = 14usize;
7486 pub const DEFAULT: Self = Self {
7487 time_boot_ms: 0_u32,
7488 mode_id: CameraMode::DEFAULT,
7489 zoomLevel: 0.0_f32,
7490 focusLevel: 0.0_f32,
7491 camera_device_id: 0_u8,
7492 };
7493 #[cfg(feature = "arbitrary")]
7494 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7495 use arbitrary::{Arbitrary, Unstructured};
7496 let mut buf = [0u8; 1024];
7497 rng.fill_bytes(&mut buf);
7498 let mut unstructured = Unstructured::new(&buf);
7499 Self::arbitrary(&mut unstructured).unwrap_or_default()
7500 }
7501}
7502impl Default for CAMERA_SETTINGS_DATA {
7503 fn default() -> Self {
7504 Self::DEFAULT.clone()
7505 }
7506}
7507impl MessageData for CAMERA_SETTINGS_DATA {
7508 type Message = MavMessage;
7509 const ID: u32 = 260u32;
7510 const NAME: &'static str = "CAMERA_SETTINGS";
7511 const EXTRA_CRC: u8 = 146u8;
7512 const ENCODED_LEN: usize = 14usize;
7513 fn deser(
7514 _version: MavlinkVersion,
7515 __input: &[u8],
7516 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7517 let avail_len = __input.len();
7518 let mut payload_buf = [0; Self::ENCODED_LEN];
7519 let mut buf = if avail_len < Self::ENCODED_LEN {
7520 payload_buf[0..avail_len].copy_from_slice(__input);
7521 Bytes::new(&payload_buf)
7522 } else {
7523 Bytes::new(__input)
7524 };
7525 let mut __struct = Self::default();
7526 __struct.time_boot_ms = buf.get_u32_le();
7527 let tmp = buf.get_u8();
7528 __struct.mode_id =
7529 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7530 enum_type: "CameraMode",
7531 value: tmp as u64,
7532 })?;
7533 __struct.zoomLevel = buf.get_f32_le();
7534 __struct.focusLevel = buf.get_f32_le();
7535 __struct.camera_device_id = buf.get_u8();
7536 Ok(__struct)
7537 }
7538 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7539 let mut __tmp = BytesMut::new(bytes);
7540 #[allow(clippy::absurd_extreme_comparisons)]
7541 #[allow(unused_comparisons)]
7542 if __tmp.remaining() < Self::ENCODED_LEN {
7543 panic!(
7544 "buffer is too small (need {} bytes, but got {})",
7545 Self::ENCODED_LEN,
7546 __tmp.remaining(),
7547 )
7548 }
7549 __tmp.put_u32_le(self.time_boot_ms);
7550 __tmp.put_u8(self.mode_id as u8);
7551 if matches!(version, MavlinkVersion::V2) {
7552 __tmp.put_f32_le(self.zoomLevel);
7553 __tmp.put_f32_le(self.focusLevel);
7554 __tmp.put_u8(self.camera_device_id);
7555 let len = __tmp.len();
7556 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7557 } else {
7558 __tmp.len()
7559 }
7560 }
7561}
7562#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7563#[doc = ""]
7564#[doc = "ID: 277"]
7565#[derive(Debug, Clone, PartialEq)]
7566#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7567#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7568#[cfg_attr(feature = "ts", derive(TS))]
7569#[cfg_attr(feature = "ts", ts(export))]
7570pub struct CAMERA_THERMAL_RANGE_DATA {
7571 #[doc = "Timestamp (time since system boot)."]
7572 pub time_boot_ms: u32,
7573 #[doc = "Temperature max."]
7574 pub max: f32,
7575 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7576 pub max_point_x: f32,
7577 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7578 pub max_point_y: f32,
7579 #[doc = "Temperature min."]
7580 pub min: f32,
7581 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7582 pub min_point_x: f32,
7583 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7584 pub min_point_y: f32,
7585 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7586 pub stream_id: u8,
7587 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7588 pub camera_device_id: u8,
7589}
7590impl CAMERA_THERMAL_RANGE_DATA {
7591 pub const ENCODED_LEN: usize = 30usize;
7592 pub const DEFAULT: Self = Self {
7593 time_boot_ms: 0_u32,
7594 max: 0.0_f32,
7595 max_point_x: 0.0_f32,
7596 max_point_y: 0.0_f32,
7597 min: 0.0_f32,
7598 min_point_x: 0.0_f32,
7599 min_point_y: 0.0_f32,
7600 stream_id: 0_u8,
7601 camera_device_id: 0_u8,
7602 };
7603 #[cfg(feature = "arbitrary")]
7604 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7605 use arbitrary::{Arbitrary, Unstructured};
7606 let mut buf = [0u8; 1024];
7607 rng.fill_bytes(&mut buf);
7608 let mut unstructured = Unstructured::new(&buf);
7609 Self::arbitrary(&mut unstructured).unwrap_or_default()
7610 }
7611}
7612impl Default for CAMERA_THERMAL_RANGE_DATA {
7613 fn default() -> Self {
7614 Self::DEFAULT.clone()
7615 }
7616}
7617impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7618 type Message = MavMessage;
7619 const ID: u32 = 277u32;
7620 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7621 const EXTRA_CRC: u8 = 62u8;
7622 const ENCODED_LEN: usize = 30usize;
7623 fn deser(
7624 _version: MavlinkVersion,
7625 __input: &[u8],
7626 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7627 let avail_len = __input.len();
7628 let mut payload_buf = [0; Self::ENCODED_LEN];
7629 let mut buf = if avail_len < Self::ENCODED_LEN {
7630 payload_buf[0..avail_len].copy_from_slice(__input);
7631 Bytes::new(&payload_buf)
7632 } else {
7633 Bytes::new(__input)
7634 };
7635 let mut __struct = Self::default();
7636 __struct.time_boot_ms = buf.get_u32_le();
7637 __struct.max = buf.get_f32_le();
7638 __struct.max_point_x = buf.get_f32_le();
7639 __struct.max_point_y = buf.get_f32_le();
7640 __struct.min = buf.get_f32_le();
7641 __struct.min_point_x = buf.get_f32_le();
7642 __struct.min_point_y = buf.get_f32_le();
7643 __struct.stream_id = buf.get_u8();
7644 __struct.camera_device_id = buf.get_u8();
7645 Ok(__struct)
7646 }
7647 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7648 let mut __tmp = BytesMut::new(bytes);
7649 #[allow(clippy::absurd_extreme_comparisons)]
7650 #[allow(unused_comparisons)]
7651 if __tmp.remaining() < Self::ENCODED_LEN {
7652 panic!(
7653 "buffer is too small (need {} bytes, but got {})",
7654 Self::ENCODED_LEN,
7655 __tmp.remaining(),
7656 )
7657 }
7658 __tmp.put_u32_le(self.time_boot_ms);
7659 __tmp.put_f32_le(self.max);
7660 __tmp.put_f32_le(self.max_point_x);
7661 __tmp.put_f32_le(self.max_point_y);
7662 __tmp.put_f32_le(self.min);
7663 __tmp.put_f32_le(self.min_point_x);
7664 __tmp.put_f32_le(self.min_point_y);
7665 __tmp.put_u8(self.stream_id);
7666 __tmp.put_u8(self.camera_device_id);
7667 if matches!(version, MavlinkVersion::V2) {
7668 let len = __tmp.len();
7669 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7670 } else {
7671 __tmp.len()
7672 }
7673 }
7674}
7675#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7676#[doc = ""]
7677#[doc = "ID: 276"]
7678#[derive(Debug, Clone, PartialEq)]
7679#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7680#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7681#[cfg_attr(feature = "ts", derive(TS))]
7682#[cfg_attr(feature = "ts", ts(export))]
7683pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7684 #[doc = "Latitude of tracked object"]
7685 pub lat: i32,
7686 #[doc = "Longitude of tracked object"]
7687 pub lon: i32,
7688 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7689 pub alt: f32,
7690 #[doc = "Horizontal accuracy. NAN if unknown"]
7691 pub h_acc: f32,
7692 #[doc = "Vertical accuracy. NAN if unknown"]
7693 pub v_acc: f32,
7694 #[doc = "North velocity of tracked object. NAN if unknown"]
7695 pub vel_n: f32,
7696 #[doc = "East velocity of tracked object. NAN if unknown"]
7697 pub vel_e: f32,
7698 #[doc = "Down velocity of tracked object. NAN if unknown"]
7699 pub vel_d: f32,
7700 #[doc = "Velocity accuracy. NAN if unknown"]
7701 pub vel_acc: f32,
7702 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7703 pub dist: f32,
7704 #[doc = "Heading in radians, in NED. NAN if unknown"]
7705 pub hdg: f32,
7706 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7707 pub hdg_acc: f32,
7708 #[doc = "Current tracking status"]
7709 pub tracking_status: CameraTrackingStatusFlags,
7710 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7711 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7712 pub camera_device_id: u8,
7713}
7714impl CAMERA_TRACKING_GEO_STATUS_DATA {
7715 pub const ENCODED_LEN: usize = 50usize;
7716 pub const DEFAULT: Self = Self {
7717 lat: 0_i32,
7718 lon: 0_i32,
7719 alt: 0.0_f32,
7720 h_acc: 0.0_f32,
7721 v_acc: 0.0_f32,
7722 vel_n: 0.0_f32,
7723 vel_e: 0.0_f32,
7724 vel_d: 0.0_f32,
7725 vel_acc: 0.0_f32,
7726 dist: 0.0_f32,
7727 hdg: 0.0_f32,
7728 hdg_acc: 0.0_f32,
7729 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7730 camera_device_id: 0_u8,
7731 };
7732 #[cfg(feature = "arbitrary")]
7733 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7734 use arbitrary::{Arbitrary, Unstructured};
7735 let mut buf = [0u8; 1024];
7736 rng.fill_bytes(&mut buf);
7737 let mut unstructured = Unstructured::new(&buf);
7738 Self::arbitrary(&mut unstructured).unwrap_or_default()
7739 }
7740}
7741impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7742 fn default() -> Self {
7743 Self::DEFAULT.clone()
7744 }
7745}
7746impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7747 type Message = MavMessage;
7748 const ID: u32 = 276u32;
7749 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7750 const EXTRA_CRC: u8 = 18u8;
7751 const ENCODED_LEN: usize = 50usize;
7752 fn deser(
7753 _version: MavlinkVersion,
7754 __input: &[u8],
7755 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7756 let avail_len = __input.len();
7757 let mut payload_buf = [0; Self::ENCODED_LEN];
7758 let mut buf = if avail_len < Self::ENCODED_LEN {
7759 payload_buf[0..avail_len].copy_from_slice(__input);
7760 Bytes::new(&payload_buf)
7761 } else {
7762 Bytes::new(__input)
7763 };
7764 let mut __struct = Self::default();
7765 __struct.lat = buf.get_i32_le();
7766 __struct.lon = buf.get_i32_le();
7767 __struct.alt = buf.get_f32_le();
7768 __struct.h_acc = buf.get_f32_le();
7769 __struct.v_acc = buf.get_f32_le();
7770 __struct.vel_n = buf.get_f32_le();
7771 __struct.vel_e = buf.get_f32_le();
7772 __struct.vel_d = buf.get_f32_le();
7773 __struct.vel_acc = buf.get_f32_le();
7774 __struct.dist = buf.get_f32_le();
7775 __struct.hdg = buf.get_f32_le();
7776 __struct.hdg_acc = buf.get_f32_le();
7777 let tmp = buf.get_u8();
7778 __struct.tracking_status =
7779 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7780 enum_type: "CameraTrackingStatusFlags",
7781 value: tmp as u64,
7782 })?;
7783 __struct.camera_device_id = buf.get_u8();
7784 Ok(__struct)
7785 }
7786 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7787 let mut __tmp = BytesMut::new(bytes);
7788 #[allow(clippy::absurd_extreme_comparisons)]
7789 #[allow(unused_comparisons)]
7790 if __tmp.remaining() < Self::ENCODED_LEN {
7791 panic!(
7792 "buffer is too small (need {} bytes, but got {})",
7793 Self::ENCODED_LEN,
7794 __tmp.remaining(),
7795 )
7796 }
7797 __tmp.put_i32_le(self.lat);
7798 __tmp.put_i32_le(self.lon);
7799 __tmp.put_f32_le(self.alt);
7800 __tmp.put_f32_le(self.h_acc);
7801 __tmp.put_f32_le(self.v_acc);
7802 __tmp.put_f32_le(self.vel_n);
7803 __tmp.put_f32_le(self.vel_e);
7804 __tmp.put_f32_le(self.vel_d);
7805 __tmp.put_f32_le(self.vel_acc);
7806 __tmp.put_f32_le(self.dist);
7807 __tmp.put_f32_le(self.hdg);
7808 __tmp.put_f32_le(self.hdg_acc);
7809 __tmp.put_u8(self.tracking_status as u8);
7810 if matches!(version, MavlinkVersion::V2) {
7811 __tmp.put_u8(self.camera_device_id);
7812 let len = __tmp.len();
7813 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7814 } else {
7815 __tmp.len()
7816 }
7817 }
7818}
7819#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7820#[doc = ""]
7821#[doc = "ID: 275"]
7822#[derive(Debug, Clone, PartialEq)]
7823#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7824#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7825#[cfg_attr(feature = "ts", derive(TS))]
7826#[cfg_attr(feature = "ts", ts(export))]
7827pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
7828 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7829 pub point_x: f32,
7830 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7831 pub point_y: f32,
7832 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
7833 pub radius: f32,
7834 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7835 pub rec_top_x: f32,
7836 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7837 pub rec_top_y: f32,
7838 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7839 pub rec_bottom_x: f32,
7840 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7841 pub rec_bottom_y: f32,
7842 #[doc = "Current tracking status"]
7843 pub tracking_status: CameraTrackingStatusFlags,
7844 #[doc = "Current tracking mode"]
7845 pub tracking_mode: CameraTrackingMode,
7846 #[doc = "Defines location of target data"]
7847 pub target_data: CameraTrackingTargetData,
7848 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7849 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7850 pub camera_device_id: u8,
7851}
7852impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
7853 pub const ENCODED_LEN: usize = 32usize;
7854 pub const DEFAULT: Self = Self {
7855 point_x: 0.0_f32,
7856 point_y: 0.0_f32,
7857 radius: 0.0_f32,
7858 rec_top_x: 0.0_f32,
7859 rec_top_y: 0.0_f32,
7860 rec_bottom_x: 0.0_f32,
7861 rec_bottom_y: 0.0_f32,
7862 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7863 tracking_mode: CameraTrackingMode::DEFAULT,
7864 target_data: CameraTrackingTargetData::DEFAULT,
7865 camera_device_id: 0_u8,
7866 };
7867 #[cfg(feature = "arbitrary")]
7868 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7869 use arbitrary::{Arbitrary, Unstructured};
7870 let mut buf = [0u8; 1024];
7871 rng.fill_bytes(&mut buf);
7872 let mut unstructured = Unstructured::new(&buf);
7873 Self::arbitrary(&mut unstructured).unwrap_or_default()
7874 }
7875}
7876impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7877 fn default() -> Self {
7878 Self::DEFAULT.clone()
7879 }
7880}
7881impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7882 type Message = MavMessage;
7883 const ID: u32 = 275u32;
7884 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
7885 const EXTRA_CRC: u8 = 126u8;
7886 const ENCODED_LEN: usize = 32usize;
7887 fn deser(
7888 _version: MavlinkVersion,
7889 __input: &[u8],
7890 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7891 let avail_len = __input.len();
7892 let mut payload_buf = [0; Self::ENCODED_LEN];
7893 let mut buf = if avail_len < Self::ENCODED_LEN {
7894 payload_buf[0..avail_len].copy_from_slice(__input);
7895 Bytes::new(&payload_buf)
7896 } else {
7897 Bytes::new(__input)
7898 };
7899 let mut __struct = Self::default();
7900 __struct.point_x = buf.get_f32_le();
7901 __struct.point_y = buf.get_f32_le();
7902 __struct.radius = buf.get_f32_le();
7903 __struct.rec_top_x = buf.get_f32_le();
7904 __struct.rec_top_y = buf.get_f32_le();
7905 __struct.rec_bottom_x = buf.get_f32_le();
7906 __struct.rec_bottom_y = buf.get_f32_le();
7907 let tmp = buf.get_u8();
7908 __struct.tracking_status =
7909 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7910 enum_type: "CameraTrackingStatusFlags",
7911 value: tmp as u64,
7912 })?;
7913 let tmp = buf.get_u8();
7914 __struct.tracking_mode =
7915 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7916 enum_type: "CameraTrackingMode",
7917 value: tmp as u64,
7918 })?;
7919 let tmp = buf.get_u8();
7920 __struct.target_data =
7921 CameraTrackingTargetData::from_bits(tmp as <CameraTrackingTargetData as Flags>::Bits)
7922 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7923 flag_type: "CameraTrackingTargetData",
7924 value: tmp as u64,
7925 })?;
7926 __struct.camera_device_id = buf.get_u8();
7927 Ok(__struct)
7928 }
7929 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7930 let mut __tmp = BytesMut::new(bytes);
7931 #[allow(clippy::absurd_extreme_comparisons)]
7932 #[allow(unused_comparisons)]
7933 if __tmp.remaining() < Self::ENCODED_LEN {
7934 panic!(
7935 "buffer is too small (need {} bytes, but got {})",
7936 Self::ENCODED_LEN,
7937 __tmp.remaining(),
7938 )
7939 }
7940 __tmp.put_f32_le(self.point_x);
7941 __tmp.put_f32_le(self.point_y);
7942 __tmp.put_f32_le(self.radius);
7943 __tmp.put_f32_le(self.rec_top_x);
7944 __tmp.put_f32_le(self.rec_top_y);
7945 __tmp.put_f32_le(self.rec_bottom_x);
7946 __tmp.put_f32_le(self.rec_bottom_y);
7947 __tmp.put_u8(self.tracking_status as u8);
7948 __tmp.put_u8(self.tracking_mode as u8);
7949 __tmp.put_u8(self.target_data.bits() as u8);
7950 if matches!(version, MavlinkVersion::V2) {
7951 __tmp.put_u8(self.camera_device_id);
7952 let len = __tmp.len();
7953 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7954 } else {
7955 __tmp.len()
7956 }
7957 }
7958}
7959#[doc = "Camera-IMU triggering and synchronisation message."]
7960#[doc = ""]
7961#[doc = "ID: 112"]
7962#[derive(Debug, Clone, PartialEq)]
7963#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7964#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7965#[cfg_attr(feature = "ts", derive(TS))]
7966#[cfg_attr(feature = "ts", ts(export))]
7967pub struct CAMERA_TRIGGER_DATA {
7968 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7969 pub time_usec: u64,
7970 #[doc = "Image frame sequence"]
7971 pub seq: u32,
7972}
7973impl CAMERA_TRIGGER_DATA {
7974 pub const ENCODED_LEN: usize = 12usize;
7975 pub const DEFAULT: Self = Self {
7976 time_usec: 0_u64,
7977 seq: 0_u32,
7978 };
7979 #[cfg(feature = "arbitrary")]
7980 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7981 use arbitrary::{Arbitrary, Unstructured};
7982 let mut buf = [0u8; 1024];
7983 rng.fill_bytes(&mut buf);
7984 let mut unstructured = Unstructured::new(&buf);
7985 Self::arbitrary(&mut unstructured).unwrap_or_default()
7986 }
7987}
7988impl Default for CAMERA_TRIGGER_DATA {
7989 fn default() -> Self {
7990 Self::DEFAULT.clone()
7991 }
7992}
7993impl MessageData for CAMERA_TRIGGER_DATA {
7994 type Message = MavMessage;
7995 const ID: u32 = 112u32;
7996 const NAME: &'static str = "CAMERA_TRIGGER";
7997 const EXTRA_CRC: u8 = 174u8;
7998 const ENCODED_LEN: usize = 12usize;
7999 fn deser(
8000 _version: MavlinkVersion,
8001 __input: &[u8],
8002 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8003 let avail_len = __input.len();
8004 let mut payload_buf = [0; Self::ENCODED_LEN];
8005 let mut buf = if avail_len < Self::ENCODED_LEN {
8006 payload_buf[0..avail_len].copy_from_slice(__input);
8007 Bytes::new(&payload_buf)
8008 } else {
8009 Bytes::new(__input)
8010 };
8011 let mut __struct = Self::default();
8012 __struct.time_usec = buf.get_u64_le();
8013 __struct.seq = buf.get_u32_le();
8014 Ok(__struct)
8015 }
8016 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8017 let mut __tmp = BytesMut::new(bytes);
8018 #[allow(clippy::absurd_extreme_comparisons)]
8019 #[allow(unused_comparisons)]
8020 if __tmp.remaining() < Self::ENCODED_LEN {
8021 panic!(
8022 "buffer is too small (need {} bytes, but got {})",
8023 Self::ENCODED_LEN,
8024 __tmp.remaining(),
8025 )
8026 }
8027 __tmp.put_u64_le(self.time_usec);
8028 __tmp.put_u32_le(self.seq);
8029 if matches!(version, MavlinkVersion::V2) {
8030 let len = __tmp.len();
8031 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8032 } else {
8033 __tmp.len()
8034 }
8035 }
8036}
8037#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
8038#[doc = ""]
8039#[doc = "ID: 387"]
8040#[derive(Debug, Clone, PartialEq)]
8041#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8042#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8043#[cfg_attr(feature = "ts", derive(TS))]
8044#[cfg_attr(feature = "ts", ts(export))]
8045pub struct CANFD_FRAME_DATA {
8046 #[doc = "Frame ID"]
8047 pub id: u32,
8048 #[doc = "System ID."]
8049 pub target_system: u8,
8050 #[doc = "Component ID."]
8051 pub target_component: u8,
8052 #[doc = "bus number"]
8053 pub bus: u8,
8054 #[doc = "Frame length"]
8055 pub len: u8,
8056 #[doc = "Frame data"]
8057 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8058 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8059 pub data: [u8; 64],
8060}
8061impl CANFD_FRAME_DATA {
8062 pub const ENCODED_LEN: usize = 72usize;
8063 pub const DEFAULT: Self = Self {
8064 id: 0_u32,
8065 target_system: 0_u8,
8066 target_component: 0_u8,
8067 bus: 0_u8,
8068 len: 0_u8,
8069 data: [0_u8; 64usize],
8070 };
8071 #[cfg(feature = "arbitrary")]
8072 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8073 use arbitrary::{Arbitrary, Unstructured};
8074 let mut buf = [0u8; 1024];
8075 rng.fill_bytes(&mut buf);
8076 let mut unstructured = Unstructured::new(&buf);
8077 Self::arbitrary(&mut unstructured).unwrap_or_default()
8078 }
8079}
8080impl Default for CANFD_FRAME_DATA {
8081 fn default() -> Self {
8082 Self::DEFAULT.clone()
8083 }
8084}
8085impl MessageData for CANFD_FRAME_DATA {
8086 type Message = MavMessage;
8087 const ID: u32 = 387u32;
8088 const NAME: &'static str = "CANFD_FRAME";
8089 const EXTRA_CRC: u8 = 4u8;
8090 const ENCODED_LEN: usize = 72usize;
8091 fn deser(
8092 _version: MavlinkVersion,
8093 __input: &[u8],
8094 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8095 let avail_len = __input.len();
8096 let mut payload_buf = [0; Self::ENCODED_LEN];
8097 let mut buf = if avail_len < Self::ENCODED_LEN {
8098 payload_buf[0..avail_len].copy_from_slice(__input);
8099 Bytes::new(&payload_buf)
8100 } else {
8101 Bytes::new(__input)
8102 };
8103 let mut __struct = Self::default();
8104 __struct.id = buf.get_u32_le();
8105 __struct.target_system = buf.get_u8();
8106 __struct.target_component = buf.get_u8();
8107 __struct.bus = buf.get_u8();
8108 __struct.len = buf.get_u8();
8109 for v in &mut __struct.data {
8110 let val = buf.get_u8();
8111 *v = val;
8112 }
8113 Ok(__struct)
8114 }
8115 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8116 let mut __tmp = BytesMut::new(bytes);
8117 #[allow(clippy::absurd_extreme_comparisons)]
8118 #[allow(unused_comparisons)]
8119 if __tmp.remaining() < Self::ENCODED_LEN {
8120 panic!(
8121 "buffer is too small (need {} bytes, but got {})",
8122 Self::ENCODED_LEN,
8123 __tmp.remaining(),
8124 )
8125 }
8126 __tmp.put_u32_le(self.id);
8127 __tmp.put_u8(self.target_system);
8128 __tmp.put_u8(self.target_component);
8129 __tmp.put_u8(self.bus);
8130 __tmp.put_u8(self.len);
8131 for val in &self.data {
8132 __tmp.put_u8(*val);
8133 }
8134 if matches!(version, MavlinkVersion::V2) {
8135 let len = __tmp.len();
8136 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8137 } else {
8138 __tmp.len()
8139 }
8140 }
8141}
8142#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
8143#[doc = ""]
8144#[doc = "ID: 388"]
8145#[derive(Debug, Clone, PartialEq)]
8146#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8147#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8148#[cfg_attr(feature = "ts", derive(TS))]
8149#[cfg_attr(feature = "ts", ts(export))]
8150pub struct CAN_FILTER_MODIFY_DATA {
8151 #[doc = "filter IDs, length num_ids"]
8152 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8153 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8154 pub ids: [u16; 16],
8155 #[doc = "System ID."]
8156 pub target_system: u8,
8157 #[doc = "Component ID."]
8158 pub target_component: u8,
8159 #[doc = "bus number"]
8160 pub bus: u8,
8161 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
8162 pub operation: CanFilterOp,
8163 #[doc = "number of IDs in filter list"]
8164 pub num_ids: u8,
8165}
8166impl CAN_FILTER_MODIFY_DATA {
8167 pub const ENCODED_LEN: usize = 37usize;
8168 pub const DEFAULT: Self = Self {
8169 ids: [0_u16; 16usize],
8170 target_system: 0_u8,
8171 target_component: 0_u8,
8172 bus: 0_u8,
8173 operation: CanFilterOp::DEFAULT,
8174 num_ids: 0_u8,
8175 };
8176 #[cfg(feature = "arbitrary")]
8177 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8178 use arbitrary::{Arbitrary, Unstructured};
8179 let mut buf = [0u8; 1024];
8180 rng.fill_bytes(&mut buf);
8181 let mut unstructured = Unstructured::new(&buf);
8182 Self::arbitrary(&mut unstructured).unwrap_or_default()
8183 }
8184}
8185impl Default for CAN_FILTER_MODIFY_DATA {
8186 fn default() -> Self {
8187 Self::DEFAULT.clone()
8188 }
8189}
8190impl MessageData for CAN_FILTER_MODIFY_DATA {
8191 type Message = MavMessage;
8192 const ID: u32 = 388u32;
8193 const NAME: &'static str = "CAN_FILTER_MODIFY";
8194 const EXTRA_CRC: u8 = 8u8;
8195 const ENCODED_LEN: usize = 37usize;
8196 fn deser(
8197 _version: MavlinkVersion,
8198 __input: &[u8],
8199 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8200 let avail_len = __input.len();
8201 let mut payload_buf = [0; Self::ENCODED_LEN];
8202 let mut buf = if avail_len < Self::ENCODED_LEN {
8203 payload_buf[0..avail_len].copy_from_slice(__input);
8204 Bytes::new(&payload_buf)
8205 } else {
8206 Bytes::new(__input)
8207 };
8208 let mut __struct = Self::default();
8209 for v in &mut __struct.ids {
8210 let val = buf.get_u16_le();
8211 *v = val;
8212 }
8213 __struct.target_system = buf.get_u8();
8214 __struct.target_component = buf.get_u8();
8215 __struct.bus = buf.get_u8();
8216 let tmp = buf.get_u8();
8217 __struct.operation =
8218 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8219 enum_type: "CanFilterOp",
8220 value: tmp as u64,
8221 })?;
8222 __struct.num_ids = buf.get_u8();
8223 Ok(__struct)
8224 }
8225 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8226 let mut __tmp = BytesMut::new(bytes);
8227 #[allow(clippy::absurd_extreme_comparisons)]
8228 #[allow(unused_comparisons)]
8229 if __tmp.remaining() < Self::ENCODED_LEN {
8230 panic!(
8231 "buffer is too small (need {} bytes, but got {})",
8232 Self::ENCODED_LEN,
8233 __tmp.remaining(),
8234 )
8235 }
8236 for val in &self.ids {
8237 __tmp.put_u16_le(*val);
8238 }
8239 __tmp.put_u8(self.target_system);
8240 __tmp.put_u8(self.target_component);
8241 __tmp.put_u8(self.bus);
8242 __tmp.put_u8(self.operation as u8);
8243 __tmp.put_u8(self.num_ids);
8244 if matches!(version, MavlinkVersion::V2) {
8245 let len = __tmp.len();
8246 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8247 } else {
8248 __tmp.len()
8249 }
8250 }
8251}
8252#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
8253#[doc = ""]
8254#[doc = "ID: 386"]
8255#[derive(Debug, Clone, PartialEq)]
8256#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8258#[cfg_attr(feature = "ts", derive(TS))]
8259#[cfg_attr(feature = "ts", ts(export))]
8260pub struct CAN_FRAME_DATA {
8261 #[doc = "Frame ID"]
8262 pub id: u32,
8263 #[doc = "System ID."]
8264 pub target_system: u8,
8265 #[doc = "Component ID."]
8266 pub target_component: u8,
8267 #[doc = "Bus number"]
8268 pub bus: u8,
8269 #[doc = "Frame length"]
8270 pub len: u8,
8271 #[doc = "Frame data"]
8272 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8273 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8274 pub data: [u8; 8],
8275}
8276impl CAN_FRAME_DATA {
8277 pub const ENCODED_LEN: usize = 16usize;
8278 pub const DEFAULT: Self = Self {
8279 id: 0_u32,
8280 target_system: 0_u8,
8281 target_component: 0_u8,
8282 bus: 0_u8,
8283 len: 0_u8,
8284 data: [0_u8; 8usize],
8285 };
8286 #[cfg(feature = "arbitrary")]
8287 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8288 use arbitrary::{Arbitrary, Unstructured};
8289 let mut buf = [0u8; 1024];
8290 rng.fill_bytes(&mut buf);
8291 let mut unstructured = Unstructured::new(&buf);
8292 Self::arbitrary(&mut unstructured).unwrap_or_default()
8293 }
8294}
8295impl Default for CAN_FRAME_DATA {
8296 fn default() -> Self {
8297 Self::DEFAULT.clone()
8298 }
8299}
8300impl MessageData for CAN_FRAME_DATA {
8301 type Message = MavMessage;
8302 const ID: u32 = 386u32;
8303 const NAME: &'static str = "CAN_FRAME";
8304 const EXTRA_CRC: u8 = 132u8;
8305 const ENCODED_LEN: usize = 16usize;
8306 fn deser(
8307 _version: MavlinkVersion,
8308 __input: &[u8],
8309 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8310 let avail_len = __input.len();
8311 let mut payload_buf = [0; Self::ENCODED_LEN];
8312 let mut buf = if avail_len < Self::ENCODED_LEN {
8313 payload_buf[0..avail_len].copy_from_slice(__input);
8314 Bytes::new(&payload_buf)
8315 } else {
8316 Bytes::new(__input)
8317 };
8318 let mut __struct = Self::default();
8319 __struct.id = buf.get_u32_le();
8320 __struct.target_system = buf.get_u8();
8321 __struct.target_component = buf.get_u8();
8322 __struct.bus = buf.get_u8();
8323 __struct.len = buf.get_u8();
8324 for v in &mut __struct.data {
8325 let val = buf.get_u8();
8326 *v = val;
8327 }
8328 Ok(__struct)
8329 }
8330 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8331 let mut __tmp = BytesMut::new(bytes);
8332 #[allow(clippy::absurd_extreme_comparisons)]
8333 #[allow(unused_comparisons)]
8334 if __tmp.remaining() < Self::ENCODED_LEN {
8335 panic!(
8336 "buffer is too small (need {} bytes, but got {})",
8337 Self::ENCODED_LEN,
8338 __tmp.remaining(),
8339 )
8340 }
8341 __tmp.put_u32_le(self.id);
8342 __tmp.put_u8(self.target_system);
8343 __tmp.put_u8(self.target_component);
8344 __tmp.put_u8(self.bus);
8345 __tmp.put_u8(self.len);
8346 for val in &self.data {
8347 __tmp.put_u8(*val);
8348 }
8349 if matches!(version, MavlinkVersion::V2) {
8350 let len = __tmp.len();
8351 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8352 } else {
8353 __tmp.len()
8354 }
8355 }
8356}
8357#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8358#[doc = ""]
8359#[doc = "ID: 336"]
8360#[derive(Debug, Clone, PartialEq)]
8361#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8362#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8363#[cfg_attr(feature = "ts", derive(TS))]
8364#[cfg_attr(feature = "ts", ts(export))]
8365pub struct CELLULAR_CONFIG_DATA {
8366 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8367 pub enable_lte: u8,
8368 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8369 pub enable_pin: u8,
8370 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8371 #[cfg_attr(feature = "ts", ts(type = "string"))]
8372 pub pin: CharArray<16>,
8373 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8374 #[cfg_attr(feature = "ts", ts(type = "string"))]
8375 pub new_pin: CharArray<16>,
8376 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8377 #[cfg_attr(feature = "ts", ts(type = "string"))]
8378 pub apn: CharArray<32>,
8379 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8380 #[cfg_attr(feature = "ts", ts(type = "string"))]
8381 pub puk: CharArray<16>,
8382 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8383 pub roaming: u8,
8384 #[doc = "Message acceptance response (sent back to GS)."]
8385 pub response: CellularConfigResponse,
8386}
8387impl CELLULAR_CONFIG_DATA {
8388 pub const ENCODED_LEN: usize = 84usize;
8389 pub const DEFAULT: Self = Self {
8390 enable_lte: 0_u8,
8391 enable_pin: 0_u8,
8392 pin: CharArray::new([0_u8; 16usize]),
8393 new_pin: CharArray::new([0_u8; 16usize]),
8394 apn: CharArray::new([0_u8; 32usize]),
8395 puk: CharArray::new([0_u8; 16usize]),
8396 roaming: 0_u8,
8397 response: CellularConfigResponse::DEFAULT,
8398 };
8399 #[cfg(feature = "arbitrary")]
8400 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8401 use arbitrary::{Arbitrary, Unstructured};
8402 let mut buf = [0u8; 1024];
8403 rng.fill_bytes(&mut buf);
8404 let mut unstructured = Unstructured::new(&buf);
8405 Self::arbitrary(&mut unstructured).unwrap_or_default()
8406 }
8407}
8408impl Default for CELLULAR_CONFIG_DATA {
8409 fn default() -> Self {
8410 Self::DEFAULT.clone()
8411 }
8412}
8413impl MessageData for CELLULAR_CONFIG_DATA {
8414 type Message = MavMessage;
8415 const ID: u32 = 336u32;
8416 const NAME: &'static str = "CELLULAR_CONFIG";
8417 const EXTRA_CRC: u8 = 245u8;
8418 const ENCODED_LEN: usize = 84usize;
8419 fn deser(
8420 _version: MavlinkVersion,
8421 __input: &[u8],
8422 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8423 let avail_len = __input.len();
8424 let mut payload_buf = [0; Self::ENCODED_LEN];
8425 let mut buf = if avail_len < Self::ENCODED_LEN {
8426 payload_buf[0..avail_len].copy_from_slice(__input);
8427 Bytes::new(&payload_buf)
8428 } else {
8429 Bytes::new(__input)
8430 };
8431 let mut __struct = Self::default();
8432 __struct.enable_lte = buf.get_u8();
8433 __struct.enable_pin = buf.get_u8();
8434 let mut tmp = [0_u8; 16usize];
8435 for v in &mut tmp {
8436 *v = buf.get_u8();
8437 }
8438 __struct.pin = CharArray::new(tmp);
8439 let mut tmp = [0_u8; 16usize];
8440 for v in &mut tmp {
8441 *v = buf.get_u8();
8442 }
8443 __struct.new_pin = CharArray::new(tmp);
8444 let mut tmp = [0_u8; 32usize];
8445 for v in &mut tmp {
8446 *v = buf.get_u8();
8447 }
8448 __struct.apn = CharArray::new(tmp);
8449 let mut tmp = [0_u8; 16usize];
8450 for v in &mut tmp {
8451 *v = buf.get_u8();
8452 }
8453 __struct.puk = CharArray::new(tmp);
8454 __struct.roaming = buf.get_u8();
8455 let tmp = buf.get_u8();
8456 __struct.response =
8457 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8458 enum_type: "CellularConfigResponse",
8459 value: tmp as u64,
8460 })?;
8461 Ok(__struct)
8462 }
8463 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8464 let mut __tmp = BytesMut::new(bytes);
8465 #[allow(clippy::absurd_extreme_comparisons)]
8466 #[allow(unused_comparisons)]
8467 if __tmp.remaining() < Self::ENCODED_LEN {
8468 panic!(
8469 "buffer is too small (need {} bytes, but got {})",
8470 Self::ENCODED_LEN,
8471 __tmp.remaining(),
8472 )
8473 }
8474 __tmp.put_u8(self.enable_lte);
8475 __tmp.put_u8(self.enable_pin);
8476 for val in &self.pin {
8477 __tmp.put_u8(*val);
8478 }
8479 for val in &self.new_pin {
8480 __tmp.put_u8(*val);
8481 }
8482 for val in &self.apn {
8483 __tmp.put_u8(*val);
8484 }
8485 for val in &self.puk {
8486 __tmp.put_u8(*val);
8487 }
8488 __tmp.put_u8(self.roaming);
8489 __tmp.put_u8(self.response as u8);
8490 if matches!(version, MavlinkVersion::V2) {
8491 let len = __tmp.len();
8492 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8493 } else {
8494 __tmp.len()
8495 }
8496 }
8497}
8498#[doc = "Report current used cellular network status."]
8499#[doc = ""]
8500#[doc = "ID: 334"]
8501#[derive(Debug, Clone, PartialEq)]
8502#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8503#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8504#[cfg_attr(feature = "ts", derive(TS))]
8505#[cfg_attr(feature = "ts", ts(export))]
8506pub struct CELLULAR_STATUS_DATA {
8507 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8508 pub mcc: u16,
8509 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8510 pub mnc: u16,
8511 #[doc = "Location area code. If unknown, set to 0"]
8512 pub lac: u16,
8513 #[doc = "Cellular modem status"]
8514 pub status: CellularStatusFlag,
8515 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8516 pub failure_reason: CellularNetworkFailedReason,
8517 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8518 pub mavtype: CellularNetworkRadioType,
8519 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8520 pub quality: u8,
8521}
8522impl CELLULAR_STATUS_DATA {
8523 pub const ENCODED_LEN: usize = 10usize;
8524 pub const DEFAULT: Self = Self {
8525 mcc: 0_u16,
8526 mnc: 0_u16,
8527 lac: 0_u16,
8528 status: CellularStatusFlag::DEFAULT,
8529 failure_reason: CellularNetworkFailedReason::DEFAULT,
8530 mavtype: CellularNetworkRadioType::DEFAULT,
8531 quality: 0_u8,
8532 };
8533 #[cfg(feature = "arbitrary")]
8534 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8535 use arbitrary::{Arbitrary, Unstructured};
8536 let mut buf = [0u8; 1024];
8537 rng.fill_bytes(&mut buf);
8538 let mut unstructured = Unstructured::new(&buf);
8539 Self::arbitrary(&mut unstructured).unwrap_or_default()
8540 }
8541}
8542impl Default for CELLULAR_STATUS_DATA {
8543 fn default() -> Self {
8544 Self::DEFAULT.clone()
8545 }
8546}
8547impl MessageData for CELLULAR_STATUS_DATA {
8548 type Message = MavMessage;
8549 const ID: u32 = 334u32;
8550 const NAME: &'static str = "CELLULAR_STATUS";
8551 const EXTRA_CRC: u8 = 72u8;
8552 const ENCODED_LEN: usize = 10usize;
8553 fn deser(
8554 _version: MavlinkVersion,
8555 __input: &[u8],
8556 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8557 let avail_len = __input.len();
8558 let mut payload_buf = [0; Self::ENCODED_LEN];
8559 let mut buf = if avail_len < Self::ENCODED_LEN {
8560 payload_buf[0..avail_len].copy_from_slice(__input);
8561 Bytes::new(&payload_buf)
8562 } else {
8563 Bytes::new(__input)
8564 };
8565 let mut __struct = Self::default();
8566 __struct.mcc = buf.get_u16_le();
8567 __struct.mnc = buf.get_u16_le();
8568 __struct.lac = buf.get_u16_le();
8569 let tmp = buf.get_u8();
8570 __struct.status =
8571 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8572 enum_type: "CellularStatusFlag",
8573 value: tmp as u64,
8574 })?;
8575 let tmp = buf.get_u8();
8576 __struct.failure_reason =
8577 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8578 enum_type: "CellularNetworkFailedReason",
8579 value: tmp as u64,
8580 })?;
8581 let tmp = buf.get_u8();
8582 __struct.mavtype =
8583 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8584 enum_type: "CellularNetworkRadioType",
8585 value: tmp as u64,
8586 })?;
8587 __struct.quality = buf.get_u8();
8588 Ok(__struct)
8589 }
8590 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8591 let mut __tmp = BytesMut::new(bytes);
8592 #[allow(clippy::absurd_extreme_comparisons)]
8593 #[allow(unused_comparisons)]
8594 if __tmp.remaining() < Self::ENCODED_LEN {
8595 panic!(
8596 "buffer is too small (need {} bytes, but got {})",
8597 Self::ENCODED_LEN,
8598 __tmp.remaining(),
8599 )
8600 }
8601 __tmp.put_u16_le(self.mcc);
8602 __tmp.put_u16_le(self.mnc);
8603 __tmp.put_u16_le(self.lac);
8604 __tmp.put_u8(self.status as u8);
8605 __tmp.put_u8(self.failure_reason as u8);
8606 __tmp.put_u8(self.mavtype as u8);
8607 __tmp.put_u8(self.quality);
8608 if matches!(version, MavlinkVersion::V2) {
8609 let len = __tmp.len();
8610 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8611 } else {
8612 __tmp.len()
8613 }
8614 }
8615}
8616#[doc = "Request to control this MAV."]
8617#[doc = ""]
8618#[doc = "ID: 5"]
8619#[derive(Debug, Clone, PartialEq)]
8620#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8621#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8622#[cfg_attr(feature = "ts", derive(TS))]
8623#[cfg_attr(feature = "ts", ts(export))]
8624pub struct CHANGE_OPERATOR_CONTROL_DATA {
8625 #[doc = "System the GCS requests control for"]
8626 pub target_system: u8,
8627 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8628 pub control_request: u8,
8629 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8630 pub version: u8,
8631 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8632 #[cfg_attr(feature = "ts", ts(type = "string"))]
8633 pub passkey: CharArray<25>,
8634}
8635impl CHANGE_OPERATOR_CONTROL_DATA {
8636 pub const ENCODED_LEN: usize = 28usize;
8637 pub const DEFAULT: Self = Self {
8638 target_system: 0_u8,
8639 control_request: 0_u8,
8640 version: 0_u8,
8641 passkey: CharArray::new([0_u8; 25usize]),
8642 };
8643 #[cfg(feature = "arbitrary")]
8644 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8645 use arbitrary::{Arbitrary, Unstructured};
8646 let mut buf = [0u8; 1024];
8647 rng.fill_bytes(&mut buf);
8648 let mut unstructured = Unstructured::new(&buf);
8649 Self::arbitrary(&mut unstructured).unwrap_or_default()
8650 }
8651}
8652impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8653 fn default() -> Self {
8654 Self::DEFAULT.clone()
8655 }
8656}
8657impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8658 type Message = MavMessage;
8659 const ID: u32 = 5u32;
8660 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8661 const EXTRA_CRC: u8 = 217u8;
8662 const ENCODED_LEN: usize = 28usize;
8663 fn deser(
8664 _version: MavlinkVersion,
8665 __input: &[u8],
8666 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8667 let avail_len = __input.len();
8668 let mut payload_buf = [0; Self::ENCODED_LEN];
8669 let mut buf = if avail_len < Self::ENCODED_LEN {
8670 payload_buf[0..avail_len].copy_from_slice(__input);
8671 Bytes::new(&payload_buf)
8672 } else {
8673 Bytes::new(__input)
8674 };
8675 let mut __struct = Self::default();
8676 __struct.target_system = buf.get_u8();
8677 __struct.control_request = buf.get_u8();
8678 __struct.version = buf.get_u8();
8679 let mut tmp = [0_u8; 25usize];
8680 for v in &mut tmp {
8681 *v = buf.get_u8();
8682 }
8683 __struct.passkey = CharArray::new(tmp);
8684 Ok(__struct)
8685 }
8686 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8687 let mut __tmp = BytesMut::new(bytes);
8688 #[allow(clippy::absurd_extreme_comparisons)]
8689 #[allow(unused_comparisons)]
8690 if __tmp.remaining() < Self::ENCODED_LEN {
8691 panic!(
8692 "buffer is too small (need {} bytes, but got {})",
8693 Self::ENCODED_LEN,
8694 __tmp.remaining(),
8695 )
8696 }
8697 __tmp.put_u8(self.target_system);
8698 __tmp.put_u8(self.control_request);
8699 __tmp.put_u8(self.version);
8700 for val in &self.passkey {
8701 __tmp.put_u8(*val);
8702 }
8703 if matches!(version, MavlinkVersion::V2) {
8704 let len = __tmp.len();
8705 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8706 } else {
8707 __tmp.len()
8708 }
8709 }
8710}
8711#[doc = "Accept / deny control of this MAV."]
8712#[doc = ""]
8713#[doc = "ID: 6"]
8714#[derive(Debug, Clone, PartialEq)]
8715#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8717#[cfg_attr(feature = "ts", derive(TS))]
8718#[cfg_attr(feature = "ts", ts(export))]
8719pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8720 #[doc = "ID of the GCS this message"]
8721 pub gcs_system_id: u8,
8722 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8723 pub control_request: u8,
8724 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8725 pub ack: u8,
8726}
8727impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8728 pub const ENCODED_LEN: usize = 3usize;
8729 pub const DEFAULT: Self = Self {
8730 gcs_system_id: 0_u8,
8731 control_request: 0_u8,
8732 ack: 0_u8,
8733 };
8734 #[cfg(feature = "arbitrary")]
8735 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8736 use arbitrary::{Arbitrary, Unstructured};
8737 let mut buf = [0u8; 1024];
8738 rng.fill_bytes(&mut buf);
8739 let mut unstructured = Unstructured::new(&buf);
8740 Self::arbitrary(&mut unstructured).unwrap_or_default()
8741 }
8742}
8743impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8744 fn default() -> Self {
8745 Self::DEFAULT.clone()
8746 }
8747}
8748impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8749 type Message = MavMessage;
8750 const ID: u32 = 6u32;
8751 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8752 const EXTRA_CRC: u8 = 104u8;
8753 const ENCODED_LEN: usize = 3usize;
8754 fn deser(
8755 _version: MavlinkVersion,
8756 __input: &[u8],
8757 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8758 let avail_len = __input.len();
8759 let mut payload_buf = [0; Self::ENCODED_LEN];
8760 let mut buf = if avail_len < Self::ENCODED_LEN {
8761 payload_buf[0..avail_len].copy_from_slice(__input);
8762 Bytes::new(&payload_buf)
8763 } else {
8764 Bytes::new(__input)
8765 };
8766 let mut __struct = Self::default();
8767 __struct.gcs_system_id = buf.get_u8();
8768 __struct.control_request = buf.get_u8();
8769 __struct.ack = buf.get_u8();
8770 Ok(__struct)
8771 }
8772 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8773 let mut __tmp = BytesMut::new(bytes);
8774 #[allow(clippy::absurd_extreme_comparisons)]
8775 #[allow(unused_comparisons)]
8776 if __tmp.remaining() < Self::ENCODED_LEN {
8777 panic!(
8778 "buffer is too small (need {} bytes, but got {})",
8779 Self::ENCODED_LEN,
8780 __tmp.remaining(),
8781 )
8782 }
8783 __tmp.put_u8(self.gcs_system_id);
8784 __tmp.put_u8(self.control_request);
8785 __tmp.put_u8(self.ack);
8786 if matches!(version, MavlinkVersion::V2) {
8787 let len = __tmp.len();
8788 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8789 } else {
8790 __tmp.len()
8791 }
8792 }
8793}
8794#[doc = "Information about a potential collision."]
8795#[doc = ""]
8796#[doc = "ID: 247"]
8797#[derive(Debug, Clone, PartialEq)]
8798#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8799#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8800#[cfg_attr(feature = "ts", derive(TS))]
8801#[cfg_attr(feature = "ts", ts(export))]
8802pub struct COLLISION_DATA {
8803 #[doc = "Unique identifier, domain based on src field"]
8804 pub id: u32,
8805 #[doc = "Estimated time until collision occurs"]
8806 pub time_to_minimum_delta: f32,
8807 #[doc = "Closest vertical distance between vehicle and object"]
8808 pub altitude_minimum_delta: f32,
8809 #[doc = "Closest horizontal distance between vehicle and object"]
8810 pub horizontal_minimum_delta: f32,
8811 #[doc = "Collision data source"]
8812 pub src: MavCollisionSrc,
8813 #[doc = "Action that is being taken to avoid this collision"]
8814 pub action: MavCollisionAction,
8815 #[doc = "How concerned the aircraft is about this collision"]
8816 pub threat_level: MavCollisionThreatLevel,
8817}
8818impl COLLISION_DATA {
8819 pub const ENCODED_LEN: usize = 19usize;
8820 pub const DEFAULT: Self = Self {
8821 id: 0_u32,
8822 time_to_minimum_delta: 0.0_f32,
8823 altitude_minimum_delta: 0.0_f32,
8824 horizontal_minimum_delta: 0.0_f32,
8825 src: MavCollisionSrc::DEFAULT,
8826 action: MavCollisionAction::DEFAULT,
8827 threat_level: MavCollisionThreatLevel::DEFAULT,
8828 };
8829 #[cfg(feature = "arbitrary")]
8830 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8831 use arbitrary::{Arbitrary, Unstructured};
8832 let mut buf = [0u8; 1024];
8833 rng.fill_bytes(&mut buf);
8834 let mut unstructured = Unstructured::new(&buf);
8835 Self::arbitrary(&mut unstructured).unwrap_or_default()
8836 }
8837}
8838impl Default for COLLISION_DATA {
8839 fn default() -> Self {
8840 Self::DEFAULT.clone()
8841 }
8842}
8843impl MessageData for COLLISION_DATA {
8844 type Message = MavMessage;
8845 const ID: u32 = 247u32;
8846 const NAME: &'static str = "COLLISION";
8847 const EXTRA_CRC: u8 = 81u8;
8848 const ENCODED_LEN: usize = 19usize;
8849 fn deser(
8850 _version: MavlinkVersion,
8851 __input: &[u8],
8852 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8853 let avail_len = __input.len();
8854 let mut payload_buf = [0; Self::ENCODED_LEN];
8855 let mut buf = if avail_len < Self::ENCODED_LEN {
8856 payload_buf[0..avail_len].copy_from_slice(__input);
8857 Bytes::new(&payload_buf)
8858 } else {
8859 Bytes::new(__input)
8860 };
8861 let mut __struct = Self::default();
8862 __struct.id = buf.get_u32_le();
8863 __struct.time_to_minimum_delta = buf.get_f32_le();
8864 __struct.altitude_minimum_delta = buf.get_f32_le();
8865 __struct.horizontal_minimum_delta = buf.get_f32_le();
8866 let tmp = buf.get_u8();
8867 __struct.src =
8868 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8869 enum_type: "MavCollisionSrc",
8870 value: tmp as u64,
8871 })?;
8872 let tmp = buf.get_u8();
8873 __struct.action =
8874 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8875 enum_type: "MavCollisionAction",
8876 value: tmp as u64,
8877 })?;
8878 let tmp = buf.get_u8();
8879 __struct.threat_level =
8880 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8881 enum_type: "MavCollisionThreatLevel",
8882 value: tmp as u64,
8883 })?;
8884 Ok(__struct)
8885 }
8886 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8887 let mut __tmp = BytesMut::new(bytes);
8888 #[allow(clippy::absurd_extreme_comparisons)]
8889 #[allow(unused_comparisons)]
8890 if __tmp.remaining() < Self::ENCODED_LEN {
8891 panic!(
8892 "buffer is too small (need {} bytes, but got {})",
8893 Self::ENCODED_LEN,
8894 __tmp.remaining(),
8895 )
8896 }
8897 __tmp.put_u32_le(self.id);
8898 __tmp.put_f32_le(self.time_to_minimum_delta);
8899 __tmp.put_f32_le(self.altitude_minimum_delta);
8900 __tmp.put_f32_le(self.horizontal_minimum_delta);
8901 __tmp.put_u8(self.src as u8);
8902 __tmp.put_u8(self.action as u8);
8903 __tmp.put_u8(self.threat_level as u8);
8904 if matches!(version, MavlinkVersion::V2) {
8905 let len = __tmp.len();
8906 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8907 } else {
8908 __tmp.len()
8909 }
8910 }
8911}
8912#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8913#[doc = ""]
8914#[doc = "ID: 77"]
8915#[derive(Debug, Clone, PartialEq)]
8916#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8917#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8918#[cfg_attr(feature = "ts", derive(TS))]
8919#[cfg_attr(feature = "ts", ts(export))]
8920pub struct COMMAND_ACK_DATA {
8921 #[doc = "Command ID (of acknowledged command)."]
8922 pub command: MavCmd,
8923 #[doc = "Result of command."]
8924 pub result: MavResult,
8925 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
8926 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8927 pub progress: u8,
8928 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
8929 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8930 pub result_param2: i32,
8931 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8932 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8933 pub target_system: u8,
8934 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8935 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8936 pub target_component: u8,
8937}
8938impl COMMAND_ACK_DATA {
8939 pub const ENCODED_LEN: usize = 10usize;
8940 pub const DEFAULT: Self = Self {
8941 command: MavCmd::DEFAULT,
8942 result: MavResult::DEFAULT,
8943 progress: 0_u8,
8944 result_param2: 0_i32,
8945 target_system: 0_u8,
8946 target_component: 0_u8,
8947 };
8948 #[cfg(feature = "arbitrary")]
8949 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8950 use arbitrary::{Arbitrary, Unstructured};
8951 let mut buf = [0u8; 1024];
8952 rng.fill_bytes(&mut buf);
8953 let mut unstructured = Unstructured::new(&buf);
8954 Self::arbitrary(&mut unstructured).unwrap_or_default()
8955 }
8956}
8957impl Default for COMMAND_ACK_DATA {
8958 fn default() -> Self {
8959 Self::DEFAULT.clone()
8960 }
8961}
8962impl MessageData for COMMAND_ACK_DATA {
8963 type Message = MavMessage;
8964 const ID: u32 = 77u32;
8965 const NAME: &'static str = "COMMAND_ACK";
8966 const EXTRA_CRC: u8 = 143u8;
8967 const ENCODED_LEN: usize = 10usize;
8968 fn deser(
8969 _version: MavlinkVersion,
8970 __input: &[u8],
8971 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8972 let avail_len = __input.len();
8973 let mut payload_buf = [0; Self::ENCODED_LEN];
8974 let mut buf = if avail_len < Self::ENCODED_LEN {
8975 payload_buf[0..avail_len].copy_from_slice(__input);
8976 Bytes::new(&payload_buf)
8977 } else {
8978 Bytes::new(__input)
8979 };
8980 let mut __struct = Self::default();
8981 let tmp = buf.get_u16_le();
8982 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8983 ::mavlink_core::error::ParserError::InvalidEnum {
8984 enum_type: "MavCmd",
8985 value: tmp as u64,
8986 },
8987 )?;
8988 let tmp = buf.get_u8();
8989 __struct.result =
8990 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8991 enum_type: "MavResult",
8992 value: tmp as u64,
8993 })?;
8994 __struct.progress = buf.get_u8();
8995 __struct.result_param2 = buf.get_i32_le();
8996 __struct.target_system = buf.get_u8();
8997 __struct.target_component = buf.get_u8();
8998 Ok(__struct)
8999 }
9000 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9001 let mut __tmp = BytesMut::new(bytes);
9002 #[allow(clippy::absurd_extreme_comparisons)]
9003 #[allow(unused_comparisons)]
9004 if __tmp.remaining() < Self::ENCODED_LEN {
9005 panic!(
9006 "buffer is too small (need {} bytes, but got {})",
9007 Self::ENCODED_LEN,
9008 __tmp.remaining(),
9009 )
9010 }
9011 __tmp.put_u16_le(self.command as u16);
9012 __tmp.put_u8(self.result as u8);
9013 if matches!(version, MavlinkVersion::V2) {
9014 __tmp.put_u8(self.progress);
9015 __tmp.put_i32_le(self.result_param2);
9016 __tmp.put_u8(self.target_system);
9017 __tmp.put_u8(self.target_component);
9018 let len = __tmp.len();
9019 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9020 } else {
9021 __tmp.len()
9022 }
9023 }
9024}
9025#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9026#[doc = ""]
9027#[doc = "ID: 80"]
9028#[derive(Debug, Clone, PartialEq)]
9029#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9030#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9031#[cfg_attr(feature = "ts", derive(TS))]
9032#[cfg_attr(feature = "ts", ts(export))]
9033pub struct COMMAND_CANCEL_DATA {
9034 #[doc = "Command ID (of command to cancel)."]
9035 pub command: MavCmd,
9036 #[doc = "System executing long running command. Should not be broadcast (0)."]
9037 pub target_system: u8,
9038 #[doc = "Component executing long running command."]
9039 pub target_component: u8,
9040}
9041impl COMMAND_CANCEL_DATA {
9042 pub const ENCODED_LEN: usize = 4usize;
9043 pub const DEFAULT: Self = Self {
9044 command: MavCmd::DEFAULT,
9045 target_system: 0_u8,
9046 target_component: 0_u8,
9047 };
9048 #[cfg(feature = "arbitrary")]
9049 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9050 use arbitrary::{Arbitrary, Unstructured};
9051 let mut buf = [0u8; 1024];
9052 rng.fill_bytes(&mut buf);
9053 let mut unstructured = Unstructured::new(&buf);
9054 Self::arbitrary(&mut unstructured).unwrap_or_default()
9055 }
9056}
9057impl Default for COMMAND_CANCEL_DATA {
9058 fn default() -> Self {
9059 Self::DEFAULT.clone()
9060 }
9061}
9062impl MessageData for COMMAND_CANCEL_DATA {
9063 type Message = MavMessage;
9064 const ID: u32 = 80u32;
9065 const NAME: &'static str = "COMMAND_CANCEL";
9066 const EXTRA_CRC: u8 = 14u8;
9067 const ENCODED_LEN: usize = 4usize;
9068 fn deser(
9069 _version: MavlinkVersion,
9070 __input: &[u8],
9071 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9072 let avail_len = __input.len();
9073 let mut payload_buf = [0; Self::ENCODED_LEN];
9074 let mut buf = if avail_len < Self::ENCODED_LEN {
9075 payload_buf[0..avail_len].copy_from_slice(__input);
9076 Bytes::new(&payload_buf)
9077 } else {
9078 Bytes::new(__input)
9079 };
9080 let mut __struct = Self::default();
9081 let tmp = buf.get_u16_le();
9082 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9083 ::mavlink_core::error::ParserError::InvalidEnum {
9084 enum_type: "MavCmd",
9085 value: tmp as u64,
9086 },
9087 )?;
9088 __struct.target_system = buf.get_u8();
9089 __struct.target_component = buf.get_u8();
9090 Ok(__struct)
9091 }
9092 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9093 let mut __tmp = BytesMut::new(bytes);
9094 #[allow(clippy::absurd_extreme_comparisons)]
9095 #[allow(unused_comparisons)]
9096 if __tmp.remaining() < Self::ENCODED_LEN {
9097 panic!(
9098 "buffer is too small (need {} bytes, but got {})",
9099 Self::ENCODED_LEN,
9100 __tmp.remaining(),
9101 )
9102 }
9103 __tmp.put_u16_le(self.command as u16);
9104 __tmp.put_u8(self.target_system);
9105 __tmp.put_u8(self.target_component);
9106 if matches!(version, MavlinkVersion::V2) {
9107 let len = __tmp.len();
9108 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9109 } else {
9110 __tmp.len()
9111 }
9112 }
9113}
9114#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9115#[doc = ""]
9116#[doc = "ID: 75"]
9117#[derive(Debug, Clone, PartialEq)]
9118#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9119#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9120#[cfg_attr(feature = "ts", derive(TS))]
9121#[cfg_attr(feature = "ts", ts(export))]
9122pub struct COMMAND_INT_DATA {
9123 #[doc = "PARAM1, see MAV_CMD enum"]
9124 pub param1: f32,
9125 #[doc = "PARAM2, see MAV_CMD enum"]
9126 pub param2: f32,
9127 #[doc = "PARAM3, see MAV_CMD enum"]
9128 pub param3: f32,
9129 #[doc = "PARAM4, see MAV_CMD enum"]
9130 pub param4: f32,
9131 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9132 pub x: i32,
9133 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9134 pub y: i32,
9135 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
9136 pub z: f32,
9137 #[doc = "The scheduled action for the mission item."]
9138 pub command: MavCmd,
9139 #[doc = "System ID"]
9140 pub target_system: u8,
9141 #[doc = "Component ID"]
9142 pub target_component: u8,
9143 #[doc = "The coordinate system of the COMMAND."]
9144 pub frame: MavFrame,
9145 #[doc = "Not used."]
9146 pub current: u8,
9147 #[doc = "Not used (set 0)."]
9148 pub autocontinue: u8,
9149}
9150impl COMMAND_INT_DATA {
9151 pub const ENCODED_LEN: usize = 35usize;
9152 pub const DEFAULT: Self = Self {
9153 param1: 0.0_f32,
9154 param2: 0.0_f32,
9155 param3: 0.0_f32,
9156 param4: 0.0_f32,
9157 x: 0_i32,
9158 y: 0_i32,
9159 z: 0.0_f32,
9160 command: MavCmd::DEFAULT,
9161 target_system: 0_u8,
9162 target_component: 0_u8,
9163 frame: MavFrame::DEFAULT,
9164 current: 0_u8,
9165 autocontinue: 0_u8,
9166 };
9167 #[cfg(feature = "arbitrary")]
9168 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9169 use arbitrary::{Arbitrary, Unstructured};
9170 let mut buf = [0u8; 1024];
9171 rng.fill_bytes(&mut buf);
9172 let mut unstructured = Unstructured::new(&buf);
9173 Self::arbitrary(&mut unstructured).unwrap_or_default()
9174 }
9175}
9176impl Default for COMMAND_INT_DATA {
9177 fn default() -> Self {
9178 Self::DEFAULT.clone()
9179 }
9180}
9181impl MessageData for COMMAND_INT_DATA {
9182 type Message = MavMessage;
9183 const ID: u32 = 75u32;
9184 const NAME: &'static str = "COMMAND_INT";
9185 const EXTRA_CRC: u8 = 158u8;
9186 const ENCODED_LEN: usize = 35usize;
9187 fn deser(
9188 _version: MavlinkVersion,
9189 __input: &[u8],
9190 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9191 let avail_len = __input.len();
9192 let mut payload_buf = [0; Self::ENCODED_LEN];
9193 let mut buf = if avail_len < Self::ENCODED_LEN {
9194 payload_buf[0..avail_len].copy_from_slice(__input);
9195 Bytes::new(&payload_buf)
9196 } else {
9197 Bytes::new(__input)
9198 };
9199 let mut __struct = Self::default();
9200 __struct.param1 = buf.get_f32_le();
9201 __struct.param2 = buf.get_f32_le();
9202 __struct.param3 = buf.get_f32_le();
9203 __struct.param4 = buf.get_f32_le();
9204 __struct.x = buf.get_i32_le();
9205 __struct.y = buf.get_i32_le();
9206 __struct.z = buf.get_f32_le();
9207 let tmp = buf.get_u16_le();
9208 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9209 ::mavlink_core::error::ParserError::InvalidEnum {
9210 enum_type: "MavCmd",
9211 value: tmp as u64,
9212 },
9213 )?;
9214 __struct.target_system = buf.get_u8();
9215 __struct.target_component = buf.get_u8();
9216 let tmp = buf.get_u8();
9217 __struct.frame =
9218 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9219 enum_type: "MavFrame",
9220 value: tmp as u64,
9221 })?;
9222 __struct.current = buf.get_u8();
9223 __struct.autocontinue = buf.get_u8();
9224 Ok(__struct)
9225 }
9226 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9227 let mut __tmp = BytesMut::new(bytes);
9228 #[allow(clippy::absurd_extreme_comparisons)]
9229 #[allow(unused_comparisons)]
9230 if __tmp.remaining() < Self::ENCODED_LEN {
9231 panic!(
9232 "buffer is too small (need {} bytes, but got {})",
9233 Self::ENCODED_LEN,
9234 __tmp.remaining(),
9235 )
9236 }
9237 __tmp.put_f32_le(self.param1);
9238 __tmp.put_f32_le(self.param2);
9239 __tmp.put_f32_le(self.param3);
9240 __tmp.put_f32_le(self.param4);
9241 __tmp.put_i32_le(self.x);
9242 __tmp.put_i32_le(self.y);
9243 __tmp.put_f32_le(self.z);
9244 __tmp.put_u16_le(self.command as u16);
9245 __tmp.put_u8(self.target_system);
9246 __tmp.put_u8(self.target_component);
9247 __tmp.put_u8(self.frame as u8);
9248 __tmp.put_u8(self.current);
9249 __tmp.put_u8(self.autocontinue);
9250 if matches!(version, MavlinkVersion::V2) {
9251 let len = __tmp.len();
9252 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9253 } else {
9254 __tmp.len()
9255 }
9256 }
9257}
9258#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9259#[doc = ""]
9260#[doc = "ID: 76"]
9261#[derive(Debug, Clone, PartialEq)]
9262#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9263#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9264#[cfg_attr(feature = "ts", derive(TS))]
9265#[cfg_attr(feature = "ts", ts(export))]
9266pub struct COMMAND_LONG_DATA {
9267 #[doc = "Parameter 1 (for the specific command)."]
9268 pub param1: f32,
9269 #[doc = "Parameter 2 (for the specific command)."]
9270 pub param2: f32,
9271 #[doc = "Parameter 3 (for the specific command)."]
9272 pub param3: f32,
9273 #[doc = "Parameter 4 (for the specific command)."]
9274 pub param4: f32,
9275 #[doc = "Parameter 5 (for the specific command)."]
9276 pub param5: f32,
9277 #[doc = "Parameter 6 (for the specific command)."]
9278 pub param6: f32,
9279 #[doc = "Parameter 7 (for the specific command)."]
9280 pub param7: f32,
9281 #[doc = "Command ID (of command to send)."]
9282 pub command: MavCmd,
9283 #[doc = "System which should execute the command"]
9284 pub target_system: u8,
9285 #[doc = "Component which should execute the command, 0 for all components"]
9286 pub target_component: u8,
9287 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9288 pub confirmation: u8,
9289}
9290impl COMMAND_LONG_DATA {
9291 pub const ENCODED_LEN: usize = 33usize;
9292 pub const DEFAULT: Self = Self {
9293 param1: 0.0_f32,
9294 param2: 0.0_f32,
9295 param3: 0.0_f32,
9296 param4: 0.0_f32,
9297 param5: 0.0_f32,
9298 param6: 0.0_f32,
9299 param7: 0.0_f32,
9300 command: MavCmd::DEFAULT,
9301 target_system: 0_u8,
9302 target_component: 0_u8,
9303 confirmation: 0_u8,
9304 };
9305 #[cfg(feature = "arbitrary")]
9306 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9307 use arbitrary::{Arbitrary, Unstructured};
9308 let mut buf = [0u8; 1024];
9309 rng.fill_bytes(&mut buf);
9310 let mut unstructured = Unstructured::new(&buf);
9311 Self::arbitrary(&mut unstructured).unwrap_or_default()
9312 }
9313}
9314impl Default for COMMAND_LONG_DATA {
9315 fn default() -> Self {
9316 Self::DEFAULT.clone()
9317 }
9318}
9319impl MessageData for COMMAND_LONG_DATA {
9320 type Message = MavMessage;
9321 const ID: u32 = 76u32;
9322 const NAME: &'static str = "COMMAND_LONG";
9323 const EXTRA_CRC: u8 = 152u8;
9324 const ENCODED_LEN: usize = 33usize;
9325 fn deser(
9326 _version: MavlinkVersion,
9327 __input: &[u8],
9328 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9329 let avail_len = __input.len();
9330 let mut payload_buf = [0; Self::ENCODED_LEN];
9331 let mut buf = if avail_len < Self::ENCODED_LEN {
9332 payload_buf[0..avail_len].copy_from_slice(__input);
9333 Bytes::new(&payload_buf)
9334 } else {
9335 Bytes::new(__input)
9336 };
9337 let mut __struct = Self::default();
9338 __struct.param1 = buf.get_f32_le();
9339 __struct.param2 = buf.get_f32_le();
9340 __struct.param3 = buf.get_f32_le();
9341 __struct.param4 = buf.get_f32_le();
9342 __struct.param5 = buf.get_f32_le();
9343 __struct.param6 = buf.get_f32_le();
9344 __struct.param7 = buf.get_f32_le();
9345 let tmp = buf.get_u16_le();
9346 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9347 ::mavlink_core::error::ParserError::InvalidEnum {
9348 enum_type: "MavCmd",
9349 value: tmp as u64,
9350 },
9351 )?;
9352 __struct.target_system = buf.get_u8();
9353 __struct.target_component = buf.get_u8();
9354 __struct.confirmation = buf.get_u8();
9355 Ok(__struct)
9356 }
9357 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9358 let mut __tmp = BytesMut::new(bytes);
9359 #[allow(clippy::absurd_extreme_comparisons)]
9360 #[allow(unused_comparisons)]
9361 if __tmp.remaining() < Self::ENCODED_LEN {
9362 panic!(
9363 "buffer is too small (need {} bytes, but got {})",
9364 Self::ENCODED_LEN,
9365 __tmp.remaining(),
9366 )
9367 }
9368 __tmp.put_f32_le(self.param1);
9369 __tmp.put_f32_le(self.param2);
9370 __tmp.put_f32_le(self.param3);
9371 __tmp.put_f32_le(self.param4);
9372 __tmp.put_f32_le(self.param5);
9373 __tmp.put_f32_le(self.param6);
9374 __tmp.put_f32_le(self.param7);
9375 __tmp.put_u16_le(self.command as u16);
9376 __tmp.put_u8(self.target_system);
9377 __tmp.put_u8(self.target_component);
9378 __tmp.put_u8(self.confirmation);
9379 if matches!(version, MavlinkVersion::V2) {
9380 let len = __tmp.len();
9381 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9382 } else {
9383 __tmp.len()
9384 }
9385 }
9386}
9387#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9388#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9389#[doc = ""]
9390#[doc = "ID: 395"]
9391#[derive(Debug, Clone, PartialEq)]
9392#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9393#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9394#[cfg_attr(feature = "ts", derive(TS))]
9395#[cfg_attr(feature = "ts", ts(export))]
9396pub struct COMPONENT_INFORMATION_DATA {
9397 #[doc = "Timestamp (time since system boot)."]
9398 pub time_boot_ms: u32,
9399 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9400 pub general_metadata_file_crc: u32,
9401 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9402 pub peripherals_metadata_file_crc: u32,
9403 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9404 #[cfg_attr(feature = "ts", ts(type = "string"))]
9405 pub general_metadata_uri: CharArray<100>,
9406 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9407 #[cfg_attr(feature = "ts", ts(type = "string"))]
9408 pub peripherals_metadata_uri: CharArray<100>,
9409}
9410impl COMPONENT_INFORMATION_DATA {
9411 pub const ENCODED_LEN: usize = 212usize;
9412 pub const DEFAULT: Self = Self {
9413 time_boot_ms: 0_u32,
9414 general_metadata_file_crc: 0_u32,
9415 peripherals_metadata_file_crc: 0_u32,
9416 general_metadata_uri: CharArray::new([0_u8; 100usize]),
9417 peripherals_metadata_uri: CharArray::new([0_u8; 100usize]),
9418 };
9419 #[cfg(feature = "arbitrary")]
9420 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9421 use arbitrary::{Arbitrary, Unstructured};
9422 let mut buf = [0u8; 1024];
9423 rng.fill_bytes(&mut buf);
9424 let mut unstructured = Unstructured::new(&buf);
9425 Self::arbitrary(&mut unstructured).unwrap_or_default()
9426 }
9427}
9428impl Default for COMPONENT_INFORMATION_DATA {
9429 fn default() -> Self {
9430 Self::DEFAULT.clone()
9431 }
9432}
9433impl MessageData for COMPONENT_INFORMATION_DATA {
9434 type Message = MavMessage;
9435 const ID: u32 = 395u32;
9436 const NAME: &'static str = "COMPONENT_INFORMATION";
9437 const EXTRA_CRC: u8 = 0u8;
9438 const ENCODED_LEN: usize = 212usize;
9439 fn deser(
9440 _version: MavlinkVersion,
9441 __input: &[u8],
9442 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9443 let avail_len = __input.len();
9444 let mut payload_buf = [0; Self::ENCODED_LEN];
9445 let mut buf = if avail_len < Self::ENCODED_LEN {
9446 payload_buf[0..avail_len].copy_from_slice(__input);
9447 Bytes::new(&payload_buf)
9448 } else {
9449 Bytes::new(__input)
9450 };
9451 let mut __struct = Self::default();
9452 __struct.time_boot_ms = buf.get_u32_le();
9453 __struct.general_metadata_file_crc = buf.get_u32_le();
9454 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9455 let mut tmp = [0_u8; 100usize];
9456 for v in &mut tmp {
9457 *v = buf.get_u8();
9458 }
9459 __struct.general_metadata_uri = CharArray::new(tmp);
9460 let mut tmp = [0_u8; 100usize];
9461 for v in &mut tmp {
9462 *v = buf.get_u8();
9463 }
9464 __struct.peripherals_metadata_uri = CharArray::new(tmp);
9465 Ok(__struct)
9466 }
9467 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9468 let mut __tmp = BytesMut::new(bytes);
9469 #[allow(clippy::absurd_extreme_comparisons)]
9470 #[allow(unused_comparisons)]
9471 if __tmp.remaining() < Self::ENCODED_LEN {
9472 panic!(
9473 "buffer is too small (need {} bytes, but got {})",
9474 Self::ENCODED_LEN,
9475 __tmp.remaining(),
9476 )
9477 }
9478 __tmp.put_u32_le(self.time_boot_ms);
9479 __tmp.put_u32_le(self.general_metadata_file_crc);
9480 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9481 for val in &self.general_metadata_uri {
9482 __tmp.put_u8(*val);
9483 }
9484 for val in &self.peripherals_metadata_uri {
9485 __tmp.put_u8(*val);
9486 }
9487 if matches!(version, MavlinkVersion::V2) {
9488 let len = __tmp.len();
9489 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9490 } else {
9491 __tmp.len()
9492 }
9493 }
9494}
9495#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9496#[doc = ""]
9497#[doc = "ID: 396"]
9498#[derive(Debug, Clone, PartialEq)]
9499#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9500#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9501#[cfg_attr(feature = "ts", derive(TS))]
9502#[cfg_attr(feature = "ts", ts(export))]
9503pub struct COMPONENT_INFORMATION_BASIC_DATA {
9504 #[doc = "Component capability flags"]
9505 pub capabilities: MavProtocolCapability,
9506 #[doc = "Timestamp (time since system boot)."]
9507 pub time_boot_ms: u32,
9508 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9509 pub time_manufacture_s: u32,
9510 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9511 #[cfg_attr(feature = "ts", ts(type = "string"))]
9512 pub vendor_name: CharArray<32>,
9513 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9514 #[cfg_attr(feature = "ts", ts(type = "string"))]
9515 pub model_name: CharArray<32>,
9516 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9517 #[cfg_attr(feature = "ts", ts(type = "string"))]
9518 pub software_version: CharArray<24>,
9519 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9520 #[cfg_attr(feature = "ts", ts(type = "string"))]
9521 pub hardware_version: CharArray<24>,
9522 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9523 #[cfg_attr(feature = "ts", ts(type = "string"))]
9524 pub serial_number: CharArray<32>,
9525}
9526impl COMPONENT_INFORMATION_BASIC_DATA {
9527 pub const ENCODED_LEN: usize = 160usize;
9528 pub const DEFAULT: Self = Self {
9529 capabilities: MavProtocolCapability::DEFAULT,
9530 time_boot_ms: 0_u32,
9531 time_manufacture_s: 0_u32,
9532 vendor_name: CharArray::new([0_u8; 32usize]),
9533 model_name: CharArray::new([0_u8; 32usize]),
9534 software_version: CharArray::new([0_u8; 24usize]),
9535 hardware_version: CharArray::new([0_u8; 24usize]),
9536 serial_number: CharArray::new([0_u8; 32usize]),
9537 };
9538 #[cfg(feature = "arbitrary")]
9539 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9540 use arbitrary::{Arbitrary, Unstructured};
9541 let mut buf = [0u8; 1024];
9542 rng.fill_bytes(&mut buf);
9543 let mut unstructured = Unstructured::new(&buf);
9544 Self::arbitrary(&mut unstructured).unwrap_or_default()
9545 }
9546}
9547impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9548 fn default() -> Self {
9549 Self::DEFAULT.clone()
9550 }
9551}
9552impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9553 type Message = MavMessage;
9554 const ID: u32 = 396u32;
9555 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9556 const EXTRA_CRC: u8 = 50u8;
9557 const ENCODED_LEN: usize = 160usize;
9558 fn deser(
9559 _version: MavlinkVersion,
9560 __input: &[u8],
9561 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9562 let avail_len = __input.len();
9563 let mut payload_buf = [0; Self::ENCODED_LEN];
9564 let mut buf = if avail_len < Self::ENCODED_LEN {
9565 payload_buf[0..avail_len].copy_from_slice(__input);
9566 Bytes::new(&payload_buf)
9567 } else {
9568 Bytes::new(__input)
9569 };
9570 let mut __struct = Self::default();
9571 let tmp = buf.get_u64_le();
9572 __struct.capabilities = MavProtocolCapability::from_bits(
9573 tmp as <MavProtocolCapability as Flags>::Bits,
9574 )
9575 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9576 flag_type: "MavProtocolCapability",
9577 value: tmp as u64,
9578 })?;
9579 __struct.time_boot_ms = buf.get_u32_le();
9580 __struct.time_manufacture_s = buf.get_u32_le();
9581 let mut tmp = [0_u8; 32usize];
9582 for v in &mut tmp {
9583 *v = buf.get_u8();
9584 }
9585 __struct.vendor_name = CharArray::new(tmp);
9586 let mut tmp = [0_u8; 32usize];
9587 for v in &mut tmp {
9588 *v = buf.get_u8();
9589 }
9590 __struct.model_name = CharArray::new(tmp);
9591 let mut tmp = [0_u8; 24usize];
9592 for v in &mut tmp {
9593 *v = buf.get_u8();
9594 }
9595 __struct.software_version = CharArray::new(tmp);
9596 let mut tmp = [0_u8; 24usize];
9597 for v in &mut tmp {
9598 *v = buf.get_u8();
9599 }
9600 __struct.hardware_version = CharArray::new(tmp);
9601 let mut tmp = [0_u8; 32usize];
9602 for v in &mut tmp {
9603 *v = buf.get_u8();
9604 }
9605 __struct.serial_number = CharArray::new(tmp);
9606 Ok(__struct)
9607 }
9608 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9609 let mut __tmp = BytesMut::new(bytes);
9610 #[allow(clippy::absurd_extreme_comparisons)]
9611 #[allow(unused_comparisons)]
9612 if __tmp.remaining() < Self::ENCODED_LEN {
9613 panic!(
9614 "buffer is too small (need {} bytes, but got {})",
9615 Self::ENCODED_LEN,
9616 __tmp.remaining(),
9617 )
9618 }
9619 __tmp.put_u64_le(self.capabilities.bits() as u64);
9620 __tmp.put_u32_le(self.time_boot_ms);
9621 __tmp.put_u32_le(self.time_manufacture_s);
9622 for val in &self.vendor_name {
9623 __tmp.put_u8(*val);
9624 }
9625 for val in &self.model_name {
9626 __tmp.put_u8(*val);
9627 }
9628 for val in &self.software_version {
9629 __tmp.put_u8(*val);
9630 }
9631 for val in &self.hardware_version {
9632 __tmp.put_u8(*val);
9633 }
9634 for val in &self.serial_number {
9635 __tmp.put_u8(*val);
9636 }
9637 if matches!(version, MavlinkVersion::V2) {
9638 let len = __tmp.len();
9639 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9640 } else {
9641 __tmp.len()
9642 }
9643 }
9644}
9645#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
9646#[doc = ""]
9647#[doc = "ID: 397"]
9648#[derive(Debug, Clone, PartialEq)]
9649#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9650#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9651#[cfg_attr(feature = "ts", derive(TS))]
9652#[cfg_attr(feature = "ts", ts(export))]
9653pub struct COMPONENT_METADATA_DATA {
9654 #[doc = "Timestamp (time since system boot)."]
9655 pub time_boot_ms: u32,
9656 #[doc = "CRC32 of the general metadata file."]
9657 pub file_crc: u32,
9658 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9659 #[cfg_attr(feature = "ts", ts(type = "string"))]
9660 pub uri: CharArray<100>,
9661}
9662impl COMPONENT_METADATA_DATA {
9663 pub const ENCODED_LEN: usize = 108usize;
9664 pub const DEFAULT: Self = Self {
9665 time_boot_ms: 0_u32,
9666 file_crc: 0_u32,
9667 uri: CharArray::new([0_u8; 100usize]),
9668 };
9669 #[cfg(feature = "arbitrary")]
9670 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9671 use arbitrary::{Arbitrary, Unstructured};
9672 let mut buf = [0u8; 1024];
9673 rng.fill_bytes(&mut buf);
9674 let mut unstructured = Unstructured::new(&buf);
9675 Self::arbitrary(&mut unstructured).unwrap_or_default()
9676 }
9677}
9678impl Default for COMPONENT_METADATA_DATA {
9679 fn default() -> Self {
9680 Self::DEFAULT.clone()
9681 }
9682}
9683impl MessageData for COMPONENT_METADATA_DATA {
9684 type Message = MavMessage;
9685 const ID: u32 = 397u32;
9686 const NAME: &'static str = "COMPONENT_METADATA";
9687 const EXTRA_CRC: u8 = 182u8;
9688 const ENCODED_LEN: usize = 108usize;
9689 fn deser(
9690 _version: MavlinkVersion,
9691 __input: &[u8],
9692 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9693 let avail_len = __input.len();
9694 let mut payload_buf = [0; Self::ENCODED_LEN];
9695 let mut buf = if avail_len < Self::ENCODED_LEN {
9696 payload_buf[0..avail_len].copy_from_slice(__input);
9697 Bytes::new(&payload_buf)
9698 } else {
9699 Bytes::new(__input)
9700 };
9701 let mut __struct = Self::default();
9702 __struct.time_boot_ms = buf.get_u32_le();
9703 __struct.file_crc = buf.get_u32_le();
9704 let mut tmp = [0_u8; 100usize];
9705 for v in &mut tmp {
9706 *v = buf.get_u8();
9707 }
9708 __struct.uri = CharArray::new(tmp);
9709 Ok(__struct)
9710 }
9711 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9712 let mut __tmp = BytesMut::new(bytes);
9713 #[allow(clippy::absurd_extreme_comparisons)]
9714 #[allow(unused_comparisons)]
9715 if __tmp.remaining() < Self::ENCODED_LEN {
9716 panic!(
9717 "buffer is too small (need {} bytes, but got {})",
9718 Self::ENCODED_LEN,
9719 __tmp.remaining(),
9720 )
9721 }
9722 __tmp.put_u32_le(self.time_boot_ms);
9723 __tmp.put_u32_le(self.file_crc);
9724 for val in &self.uri {
9725 __tmp.put_u8(*val);
9726 }
9727 if matches!(version, MavlinkVersion::V2) {
9728 let len = __tmp.len();
9729 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9730 } else {
9731 __tmp.len()
9732 }
9733 }
9734}
9735#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
9736#[doc = ""]
9737#[doc = "ID: 146"]
9738#[derive(Debug, Clone, PartialEq)]
9739#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9740#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9741#[cfg_attr(feature = "ts", derive(TS))]
9742#[cfg_attr(feature = "ts", ts(export))]
9743pub struct CONTROL_SYSTEM_STATE_DATA {
9744 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9745 pub time_usec: u64,
9746 #[doc = "X acceleration in body frame"]
9747 pub x_acc: f32,
9748 #[doc = "Y acceleration in body frame"]
9749 pub y_acc: f32,
9750 #[doc = "Z acceleration in body frame"]
9751 pub z_acc: f32,
9752 #[doc = "X velocity in body frame"]
9753 pub x_vel: f32,
9754 #[doc = "Y velocity in body frame"]
9755 pub y_vel: f32,
9756 #[doc = "Z velocity in body frame"]
9757 pub z_vel: f32,
9758 #[doc = "X position in local frame"]
9759 pub x_pos: f32,
9760 #[doc = "Y position in local frame"]
9761 pub y_pos: f32,
9762 #[doc = "Z position in local frame"]
9763 pub z_pos: f32,
9764 #[doc = "Airspeed, set to -1 if unknown"]
9765 pub airspeed: f32,
9766 #[doc = "Variance of body velocity estimate"]
9767 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9768 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9769 pub vel_variance: [f32; 3],
9770 #[doc = "Variance in local position"]
9771 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9772 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9773 pub pos_variance: [f32; 3],
9774 #[doc = "The attitude, represented as Quaternion"]
9775 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9776 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9777 pub q: [f32; 4],
9778 #[doc = "Angular rate in roll axis"]
9779 pub roll_rate: f32,
9780 #[doc = "Angular rate in pitch axis"]
9781 pub pitch_rate: f32,
9782 #[doc = "Angular rate in yaw axis"]
9783 pub yaw_rate: f32,
9784}
9785impl CONTROL_SYSTEM_STATE_DATA {
9786 pub const ENCODED_LEN: usize = 100usize;
9787 pub const DEFAULT: Self = Self {
9788 time_usec: 0_u64,
9789 x_acc: 0.0_f32,
9790 y_acc: 0.0_f32,
9791 z_acc: 0.0_f32,
9792 x_vel: 0.0_f32,
9793 y_vel: 0.0_f32,
9794 z_vel: 0.0_f32,
9795 x_pos: 0.0_f32,
9796 y_pos: 0.0_f32,
9797 z_pos: 0.0_f32,
9798 airspeed: 0.0_f32,
9799 vel_variance: [0.0_f32; 3usize],
9800 pos_variance: [0.0_f32; 3usize],
9801 q: [0.0_f32; 4usize],
9802 roll_rate: 0.0_f32,
9803 pitch_rate: 0.0_f32,
9804 yaw_rate: 0.0_f32,
9805 };
9806 #[cfg(feature = "arbitrary")]
9807 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9808 use arbitrary::{Arbitrary, Unstructured};
9809 let mut buf = [0u8; 1024];
9810 rng.fill_bytes(&mut buf);
9811 let mut unstructured = Unstructured::new(&buf);
9812 Self::arbitrary(&mut unstructured).unwrap_or_default()
9813 }
9814}
9815impl Default for CONTROL_SYSTEM_STATE_DATA {
9816 fn default() -> Self {
9817 Self::DEFAULT.clone()
9818 }
9819}
9820impl MessageData for CONTROL_SYSTEM_STATE_DATA {
9821 type Message = MavMessage;
9822 const ID: u32 = 146u32;
9823 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
9824 const EXTRA_CRC: u8 = 103u8;
9825 const ENCODED_LEN: usize = 100usize;
9826 fn deser(
9827 _version: MavlinkVersion,
9828 __input: &[u8],
9829 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9830 let avail_len = __input.len();
9831 let mut payload_buf = [0; Self::ENCODED_LEN];
9832 let mut buf = if avail_len < Self::ENCODED_LEN {
9833 payload_buf[0..avail_len].copy_from_slice(__input);
9834 Bytes::new(&payload_buf)
9835 } else {
9836 Bytes::new(__input)
9837 };
9838 let mut __struct = Self::default();
9839 __struct.time_usec = buf.get_u64_le();
9840 __struct.x_acc = buf.get_f32_le();
9841 __struct.y_acc = buf.get_f32_le();
9842 __struct.z_acc = buf.get_f32_le();
9843 __struct.x_vel = buf.get_f32_le();
9844 __struct.y_vel = buf.get_f32_le();
9845 __struct.z_vel = buf.get_f32_le();
9846 __struct.x_pos = buf.get_f32_le();
9847 __struct.y_pos = buf.get_f32_le();
9848 __struct.z_pos = buf.get_f32_le();
9849 __struct.airspeed = buf.get_f32_le();
9850 for v in &mut __struct.vel_variance {
9851 let val = buf.get_f32_le();
9852 *v = val;
9853 }
9854 for v in &mut __struct.pos_variance {
9855 let val = buf.get_f32_le();
9856 *v = val;
9857 }
9858 for v in &mut __struct.q {
9859 let val = buf.get_f32_le();
9860 *v = val;
9861 }
9862 __struct.roll_rate = buf.get_f32_le();
9863 __struct.pitch_rate = buf.get_f32_le();
9864 __struct.yaw_rate = buf.get_f32_le();
9865 Ok(__struct)
9866 }
9867 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9868 let mut __tmp = BytesMut::new(bytes);
9869 #[allow(clippy::absurd_extreme_comparisons)]
9870 #[allow(unused_comparisons)]
9871 if __tmp.remaining() < Self::ENCODED_LEN {
9872 panic!(
9873 "buffer is too small (need {} bytes, but got {})",
9874 Self::ENCODED_LEN,
9875 __tmp.remaining(),
9876 )
9877 }
9878 __tmp.put_u64_le(self.time_usec);
9879 __tmp.put_f32_le(self.x_acc);
9880 __tmp.put_f32_le(self.y_acc);
9881 __tmp.put_f32_le(self.z_acc);
9882 __tmp.put_f32_le(self.x_vel);
9883 __tmp.put_f32_le(self.y_vel);
9884 __tmp.put_f32_le(self.z_vel);
9885 __tmp.put_f32_le(self.x_pos);
9886 __tmp.put_f32_le(self.y_pos);
9887 __tmp.put_f32_le(self.z_pos);
9888 __tmp.put_f32_le(self.airspeed);
9889 for val in &self.vel_variance {
9890 __tmp.put_f32_le(*val);
9891 }
9892 for val in &self.pos_variance {
9893 __tmp.put_f32_le(*val);
9894 }
9895 for val in &self.q {
9896 __tmp.put_f32_le(*val);
9897 }
9898 __tmp.put_f32_le(self.roll_rate);
9899 __tmp.put_f32_le(self.pitch_rate);
9900 __tmp.put_f32_le(self.yaw_rate);
9901 if matches!(version, MavlinkVersion::V2) {
9902 let len = __tmp.len();
9903 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9904 } else {
9905 __tmp.len()
9906 }
9907 }
9908}
9909#[doc = "offset response to encapsulated data."]
9910#[doc = ""]
9911#[doc = "ID: 50005"]
9912#[derive(Debug, Clone, PartialEq)]
9913#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9914#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9915#[cfg_attr(feature = "ts", derive(TS))]
9916#[cfg_attr(feature = "ts", ts(export))]
9917pub struct CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
9918 #[doc = "FW Offset."]
9919 pub offset: u32,
9920 #[doc = "System ID."]
9921 pub target_system: u8,
9922 #[doc = "Component ID."]
9923 pub target_component: u8,
9924}
9925impl CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
9926 pub const ENCODED_LEN: usize = 6usize;
9927 pub const DEFAULT: Self = Self {
9928 offset: 0_u32,
9929 target_system: 0_u8,
9930 target_component: 0_u8,
9931 };
9932 #[cfg(feature = "arbitrary")]
9933 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9934 use arbitrary::{Arbitrary, Unstructured};
9935 let mut buf = [0u8; 1024];
9936 rng.fill_bytes(&mut buf);
9937 let mut unstructured = Unstructured::new(&buf);
9938 Self::arbitrary(&mut unstructured).unwrap_or_default()
9939 }
9940}
9941impl Default for CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
9942 fn default() -> Self {
9943 Self::DEFAULT.clone()
9944 }
9945}
9946impl MessageData for CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
9947 type Message = MavMessage;
9948 const ID: u32 = 50005u32;
9949 const NAME: &'static str = "CUBEPILOT_FIRMWARE_UPDATE_RESP";
9950 const EXTRA_CRC: u8 = 152u8;
9951 const ENCODED_LEN: usize = 6usize;
9952 fn deser(
9953 _version: MavlinkVersion,
9954 __input: &[u8],
9955 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9956 let avail_len = __input.len();
9957 let mut payload_buf = [0; Self::ENCODED_LEN];
9958 let mut buf = if avail_len < Self::ENCODED_LEN {
9959 payload_buf[0..avail_len].copy_from_slice(__input);
9960 Bytes::new(&payload_buf)
9961 } else {
9962 Bytes::new(__input)
9963 };
9964 let mut __struct = Self::default();
9965 __struct.offset = buf.get_u32_le();
9966 __struct.target_system = buf.get_u8();
9967 __struct.target_component = buf.get_u8();
9968 Ok(__struct)
9969 }
9970 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9971 let mut __tmp = BytesMut::new(bytes);
9972 #[allow(clippy::absurd_extreme_comparisons)]
9973 #[allow(unused_comparisons)]
9974 if __tmp.remaining() < Self::ENCODED_LEN {
9975 panic!(
9976 "buffer is too small (need {} bytes, but got {})",
9977 Self::ENCODED_LEN,
9978 __tmp.remaining(),
9979 )
9980 }
9981 __tmp.put_u32_le(self.offset);
9982 __tmp.put_u8(self.target_system);
9983 __tmp.put_u8(self.target_component);
9984 if matches!(version, MavlinkVersion::V2) {
9985 let len = __tmp.len();
9986 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9987 } else {
9988 __tmp.len()
9989 }
9990 }
9991}
9992#[doc = "Start firmware update with encapsulated data."]
9993#[doc = ""]
9994#[doc = "ID: 50004"]
9995#[derive(Debug, Clone, PartialEq)]
9996#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9997#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9998#[cfg_attr(feature = "ts", derive(TS))]
9999#[cfg_attr(feature = "ts", ts(export))]
10000pub struct CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
10001 #[doc = "FW Size."]
10002 pub size: u32,
10003 #[doc = "FW CRC."]
10004 pub crc: u32,
10005 #[doc = "System ID."]
10006 pub target_system: u8,
10007 #[doc = "Component ID."]
10008 pub target_component: u8,
10009}
10010impl CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
10011 pub const ENCODED_LEN: usize = 10usize;
10012 pub const DEFAULT: Self = Self {
10013 size: 0_u32,
10014 crc: 0_u32,
10015 target_system: 0_u8,
10016 target_component: 0_u8,
10017 };
10018 #[cfg(feature = "arbitrary")]
10019 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10020 use arbitrary::{Arbitrary, Unstructured};
10021 let mut buf = [0u8; 1024];
10022 rng.fill_bytes(&mut buf);
10023 let mut unstructured = Unstructured::new(&buf);
10024 Self::arbitrary(&mut unstructured).unwrap_or_default()
10025 }
10026}
10027impl Default for CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
10028 fn default() -> Self {
10029 Self::DEFAULT.clone()
10030 }
10031}
10032impl MessageData for CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
10033 type Message = MavMessage;
10034 const ID: u32 = 50004u32;
10035 const NAME: &'static str = "CUBEPILOT_FIRMWARE_UPDATE_START";
10036 const EXTRA_CRC: u8 = 240u8;
10037 const ENCODED_LEN: usize = 10usize;
10038 fn deser(
10039 _version: MavlinkVersion,
10040 __input: &[u8],
10041 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10042 let avail_len = __input.len();
10043 let mut payload_buf = [0; Self::ENCODED_LEN];
10044 let mut buf = if avail_len < Self::ENCODED_LEN {
10045 payload_buf[0..avail_len].copy_from_slice(__input);
10046 Bytes::new(&payload_buf)
10047 } else {
10048 Bytes::new(__input)
10049 };
10050 let mut __struct = Self::default();
10051 __struct.size = buf.get_u32_le();
10052 __struct.crc = buf.get_u32_le();
10053 __struct.target_system = buf.get_u8();
10054 __struct.target_component = buf.get_u8();
10055 Ok(__struct)
10056 }
10057 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10058 let mut __tmp = BytesMut::new(bytes);
10059 #[allow(clippy::absurd_extreme_comparisons)]
10060 #[allow(unused_comparisons)]
10061 if __tmp.remaining() < Self::ENCODED_LEN {
10062 panic!(
10063 "buffer is too small (need {} bytes, but got {})",
10064 Self::ENCODED_LEN,
10065 __tmp.remaining(),
10066 )
10067 }
10068 __tmp.put_u32_le(self.size);
10069 __tmp.put_u32_le(self.crc);
10070 __tmp.put_u8(self.target_system);
10071 __tmp.put_u8(self.target_component);
10072 if matches!(version, MavlinkVersion::V2) {
10073 let len = __tmp.len();
10074 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10075 } else {
10076 __tmp.len()
10077 }
10078 }
10079}
10080#[doc = "Raw RC Data."]
10081#[doc = ""]
10082#[doc = "ID: 50001"]
10083#[derive(Debug, Clone, PartialEq)]
10084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10085#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10086#[cfg_attr(feature = "ts", derive(TS))]
10087#[cfg_attr(feature = "ts", ts(export))]
10088pub struct CUBEPILOT_RAW_RC_DATA {
10089 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10090 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10091 pub rc_raw: [u8; 32],
10092}
10093impl CUBEPILOT_RAW_RC_DATA {
10094 pub const ENCODED_LEN: usize = 32usize;
10095 pub const DEFAULT: Self = Self {
10096 rc_raw: [0_u8; 32usize],
10097 };
10098 #[cfg(feature = "arbitrary")]
10099 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10100 use arbitrary::{Arbitrary, Unstructured};
10101 let mut buf = [0u8; 1024];
10102 rng.fill_bytes(&mut buf);
10103 let mut unstructured = Unstructured::new(&buf);
10104 Self::arbitrary(&mut unstructured).unwrap_or_default()
10105 }
10106}
10107impl Default for CUBEPILOT_RAW_RC_DATA {
10108 fn default() -> Self {
10109 Self::DEFAULT.clone()
10110 }
10111}
10112impl MessageData for CUBEPILOT_RAW_RC_DATA {
10113 type Message = MavMessage;
10114 const ID: u32 = 50001u32;
10115 const NAME: &'static str = "CUBEPILOT_RAW_RC";
10116 const EXTRA_CRC: u8 = 246u8;
10117 const ENCODED_LEN: usize = 32usize;
10118 fn deser(
10119 _version: MavlinkVersion,
10120 __input: &[u8],
10121 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10122 let avail_len = __input.len();
10123 let mut payload_buf = [0; Self::ENCODED_LEN];
10124 let mut buf = if avail_len < Self::ENCODED_LEN {
10125 payload_buf[0..avail_len].copy_from_slice(__input);
10126 Bytes::new(&payload_buf)
10127 } else {
10128 Bytes::new(__input)
10129 };
10130 let mut __struct = Self::default();
10131 for v in &mut __struct.rc_raw {
10132 let val = buf.get_u8();
10133 *v = val;
10134 }
10135 Ok(__struct)
10136 }
10137 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10138 let mut __tmp = BytesMut::new(bytes);
10139 #[allow(clippy::absurd_extreme_comparisons)]
10140 #[allow(unused_comparisons)]
10141 if __tmp.remaining() < Self::ENCODED_LEN {
10142 panic!(
10143 "buffer is too small (need {} bytes, but got {})",
10144 Self::ENCODED_LEN,
10145 __tmp.remaining(),
10146 )
10147 }
10148 for val in &self.rc_raw {
10149 __tmp.put_u8(*val);
10150 }
10151 if matches!(version, MavlinkVersion::V2) {
10152 let len = __tmp.len();
10153 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10154 } else {
10155 __tmp.len()
10156 }
10157 }
10158}
10159#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
10160#[doc = ""]
10161#[doc = "ID: 411"]
10162#[derive(Debug, Clone, PartialEq)]
10163#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10164#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10165#[cfg_attr(feature = "ts", derive(TS))]
10166#[cfg_attr(feature = "ts", ts(export))]
10167pub struct CURRENT_EVENT_SEQUENCE_DATA {
10168 #[doc = "Sequence number."]
10169 pub sequence: u16,
10170 #[doc = "Flag bitset."]
10171 pub flags: MavEventCurrentSequenceFlags,
10172}
10173impl CURRENT_EVENT_SEQUENCE_DATA {
10174 pub const ENCODED_LEN: usize = 3usize;
10175 pub const DEFAULT: Self = Self {
10176 sequence: 0_u16,
10177 flags: MavEventCurrentSequenceFlags::DEFAULT,
10178 };
10179 #[cfg(feature = "arbitrary")]
10180 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10181 use arbitrary::{Arbitrary, Unstructured};
10182 let mut buf = [0u8; 1024];
10183 rng.fill_bytes(&mut buf);
10184 let mut unstructured = Unstructured::new(&buf);
10185 Self::arbitrary(&mut unstructured).unwrap_or_default()
10186 }
10187}
10188impl Default for CURRENT_EVENT_SEQUENCE_DATA {
10189 fn default() -> Self {
10190 Self::DEFAULT.clone()
10191 }
10192}
10193impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
10194 type Message = MavMessage;
10195 const ID: u32 = 411u32;
10196 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
10197 const EXTRA_CRC: u8 = 106u8;
10198 const ENCODED_LEN: usize = 3usize;
10199 fn deser(
10200 _version: MavlinkVersion,
10201 __input: &[u8],
10202 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10203 let avail_len = __input.len();
10204 let mut payload_buf = [0; Self::ENCODED_LEN];
10205 let mut buf = if avail_len < Self::ENCODED_LEN {
10206 payload_buf[0..avail_len].copy_from_slice(__input);
10207 Bytes::new(&payload_buf)
10208 } else {
10209 Bytes::new(__input)
10210 };
10211 let mut __struct = Self::default();
10212 __struct.sequence = buf.get_u16_le();
10213 let tmp = buf.get_u8();
10214 __struct.flags =
10215 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10216 enum_type: "MavEventCurrentSequenceFlags",
10217 value: tmp as u64,
10218 })?;
10219 Ok(__struct)
10220 }
10221 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10222 let mut __tmp = BytesMut::new(bytes);
10223 #[allow(clippy::absurd_extreme_comparisons)]
10224 #[allow(unused_comparisons)]
10225 if __tmp.remaining() < Self::ENCODED_LEN {
10226 panic!(
10227 "buffer is too small (need {} bytes, but got {})",
10228 Self::ENCODED_LEN,
10229 __tmp.remaining(),
10230 )
10231 }
10232 __tmp.put_u16_le(self.sequence);
10233 __tmp.put_u8(self.flags as u8);
10234 if matches!(version, MavlinkVersion::V2) {
10235 let len = __tmp.len();
10236 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10237 } else {
10238 __tmp.len()
10239 }
10240 }
10241}
10242#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
10243#[doc = ""]
10244#[doc = "ID: 436"]
10245#[derive(Debug, Clone, PartialEq)]
10246#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10247#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10248#[cfg_attr(feature = "ts", derive(TS))]
10249#[cfg_attr(feature = "ts", ts(export))]
10250pub struct CURRENT_MODE_DATA {
10251 #[doc = "A bitfield for use for autopilot-specific flags"]
10252 pub custom_mode: u32,
10253 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
10254 pub intended_custom_mode: u32,
10255 #[doc = "Standard mode."]
10256 pub standard_mode: MavStandardMode,
10257}
10258impl CURRENT_MODE_DATA {
10259 pub const ENCODED_LEN: usize = 9usize;
10260 pub const DEFAULT: Self = Self {
10261 custom_mode: 0_u32,
10262 intended_custom_mode: 0_u32,
10263 standard_mode: MavStandardMode::DEFAULT,
10264 };
10265 #[cfg(feature = "arbitrary")]
10266 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10267 use arbitrary::{Arbitrary, Unstructured};
10268 let mut buf = [0u8; 1024];
10269 rng.fill_bytes(&mut buf);
10270 let mut unstructured = Unstructured::new(&buf);
10271 Self::arbitrary(&mut unstructured).unwrap_or_default()
10272 }
10273}
10274impl Default for CURRENT_MODE_DATA {
10275 fn default() -> Self {
10276 Self::DEFAULT.clone()
10277 }
10278}
10279impl MessageData for CURRENT_MODE_DATA {
10280 type Message = MavMessage;
10281 const ID: u32 = 436u32;
10282 const NAME: &'static str = "CURRENT_MODE";
10283 const EXTRA_CRC: u8 = 193u8;
10284 const ENCODED_LEN: usize = 9usize;
10285 fn deser(
10286 _version: MavlinkVersion,
10287 __input: &[u8],
10288 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10289 let avail_len = __input.len();
10290 let mut payload_buf = [0; Self::ENCODED_LEN];
10291 let mut buf = if avail_len < Self::ENCODED_LEN {
10292 payload_buf[0..avail_len].copy_from_slice(__input);
10293 Bytes::new(&payload_buf)
10294 } else {
10295 Bytes::new(__input)
10296 };
10297 let mut __struct = Self::default();
10298 __struct.custom_mode = buf.get_u32_le();
10299 __struct.intended_custom_mode = buf.get_u32_le();
10300 let tmp = buf.get_u8();
10301 __struct.standard_mode =
10302 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10303 enum_type: "MavStandardMode",
10304 value: tmp as u64,
10305 })?;
10306 Ok(__struct)
10307 }
10308 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10309 let mut __tmp = BytesMut::new(bytes);
10310 #[allow(clippy::absurd_extreme_comparisons)]
10311 #[allow(unused_comparisons)]
10312 if __tmp.remaining() < Self::ENCODED_LEN {
10313 panic!(
10314 "buffer is too small (need {} bytes, but got {})",
10315 Self::ENCODED_LEN,
10316 __tmp.remaining(),
10317 )
10318 }
10319 __tmp.put_u32_le(self.custom_mode);
10320 __tmp.put_u32_le(self.intended_custom_mode);
10321 __tmp.put_u8(self.standard_mode as u8);
10322 if matches!(version, MavlinkVersion::V2) {
10323 let len = __tmp.len();
10324 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10325 } else {
10326 __tmp.len()
10327 }
10328 }
10329}
10330#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
10331#[doc = "Data stream status information."]
10332#[doc = ""]
10333#[doc = "ID: 67"]
10334#[derive(Debug, Clone, PartialEq)]
10335#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10336#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10337#[cfg_attr(feature = "ts", derive(TS))]
10338#[cfg_attr(feature = "ts", ts(export))]
10339pub struct DATA_STREAM_DATA {
10340 #[doc = "The message rate"]
10341 pub message_rate: u16,
10342 #[doc = "The ID of the requested data stream"]
10343 pub stream_id: u8,
10344 #[doc = "1 stream is enabled, 0 stream is stopped."]
10345 pub on_off: u8,
10346}
10347impl DATA_STREAM_DATA {
10348 pub const ENCODED_LEN: usize = 4usize;
10349 pub const DEFAULT: Self = Self {
10350 message_rate: 0_u16,
10351 stream_id: 0_u8,
10352 on_off: 0_u8,
10353 };
10354 #[cfg(feature = "arbitrary")]
10355 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10356 use arbitrary::{Arbitrary, Unstructured};
10357 let mut buf = [0u8; 1024];
10358 rng.fill_bytes(&mut buf);
10359 let mut unstructured = Unstructured::new(&buf);
10360 Self::arbitrary(&mut unstructured).unwrap_or_default()
10361 }
10362}
10363impl Default for DATA_STREAM_DATA {
10364 fn default() -> Self {
10365 Self::DEFAULT.clone()
10366 }
10367}
10368impl MessageData for DATA_STREAM_DATA {
10369 type Message = MavMessage;
10370 const ID: u32 = 67u32;
10371 const NAME: &'static str = "DATA_STREAM";
10372 const EXTRA_CRC: u8 = 21u8;
10373 const ENCODED_LEN: usize = 4usize;
10374 fn deser(
10375 _version: MavlinkVersion,
10376 __input: &[u8],
10377 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10378 let avail_len = __input.len();
10379 let mut payload_buf = [0; Self::ENCODED_LEN];
10380 let mut buf = if avail_len < Self::ENCODED_LEN {
10381 payload_buf[0..avail_len].copy_from_slice(__input);
10382 Bytes::new(&payload_buf)
10383 } else {
10384 Bytes::new(__input)
10385 };
10386 let mut __struct = Self::default();
10387 __struct.message_rate = buf.get_u16_le();
10388 __struct.stream_id = buf.get_u8();
10389 __struct.on_off = buf.get_u8();
10390 Ok(__struct)
10391 }
10392 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10393 let mut __tmp = BytesMut::new(bytes);
10394 #[allow(clippy::absurd_extreme_comparisons)]
10395 #[allow(unused_comparisons)]
10396 if __tmp.remaining() < Self::ENCODED_LEN {
10397 panic!(
10398 "buffer is too small (need {} bytes, but got {})",
10399 Self::ENCODED_LEN,
10400 __tmp.remaining(),
10401 )
10402 }
10403 __tmp.put_u16_le(self.message_rate);
10404 __tmp.put_u8(self.stream_id);
10405 __tmp.put_u8(self.on_off);
10406 if matches!(version, MavlinkVersion::V2) {
10407 let len = __tmp.len();
10408 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10409 } else {
10410 __tmp.len()
10411 }
10412 }
10413}
10414#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10415#[doc = ""]
10416#[doc = "ID: 130"]
10417#[derive(Debug, Clone, PartialEq)]
10418#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10419#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10420#[cfg_attr(feature = "ts", derive(TS))]
10421#[cfg_attr(feature = "ts", ts(export))]
10422pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
10423 #[doc = "total data size (set on ACK only)."]
10424 pub size: u32,
10425 #[doc = "Width of a matrix or image."]
10426 pub width: u16,
10427 #[doc = "Height of a matrix or image."]
10428 pub height: u16,
10429 #[doc = "Number of packets being sent (set on ACK only)."]
10430 pub packets: u16,
10431 #[doc = "Type of requested/acknowledged data."]
10432 pub mavtype: MavlinkDataStreamType,
10433 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
10434 pub payload: u8,
10435 #[doc = "JPEG quality. Values: [1-100]."]
10436 pub jpg_quality: u8,
10437}
10438impl DATA_TRANSMISSION_HANDSHAKE_DATA {
10439 pub const ENCODED_LEN: usize = 13usize;
10440 pub const DEFAULT: Self = Self {
10441 size: 0_u32,
10442 width: 0_u16,
10443 height: 0_u16,
10444 packets: 0_u16,
10445 mavtype: MavlinkDataStreamType::DEFAULT,
10446 payload: 0_u8,
10447 jpg_quality: 0_u8,
10448 };
10449 #[cfg(feature = "arbitrary")]
10450 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10451 use arbitrary::{Arbitrary, Unstructured};
10452 let mut buf = [0u8; 1024];
10453 rng.fill_bytes(&mut buf);
10454 let mut unstructured = Unstructured::new(&buf);
10455 Self::arbitrary(&mut unstructured).unwrap_or_default()
10456 }
10457}
10458impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
10459 fn default() -> Self {
10460 Self::DEFAULT.clone()
10461 }
10462}
10463impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
10464 type Message = MavMessage;
10465 const ID: u32 = 130u32;
10466 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
10467 const EXTRA_CRC: u8 = 29u8;
10468 const ENCODED_LEN: usize = 13usize;
10469 fn deser(
10470 _version: MavlinkVersion,
10471 __input: &[u8],
10472 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10473 let avail_len = __input.len();
10474 let mut payload_buf = [0; Self::ENCODED_LEN];
10475 let mut buf = if avail_len < Self::ENCODED_LEN {
10476 payload_buf[0..avail_len].copy_from_slice(__input);
10477 Bytes::new(&payload_buf)
10478 } else {
10479 Bytes::new(__input)
10480 };
10481 let mut __struct = Self::default();
10482 __struct.size = buf.get_u32_le();
10483 __struct.width = buf.get_u16_le();
10484 __struct.height = buf.get_u16_le();
10485 __struct.packets = buf.get_u16_le();
10486 let tmp = buf.get_u8();
10487 __struct.mavtype =
10488 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10489 enum_type: "MavlinkDataStreamType",
10490 value: tmp as u64,
10491 })?;
10492 __struct.payload = buf.get_u8();
10493 __struct.jpg_quality = buf.get_u8();
10494 Ok(__struct)
10495 }
10496 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10497 let mut __tmp = BytesMut::new(bytes);
10498 #[allow(clippy::absurd_extreme_comparisons)]
10499 #[allow(unused_comparisons)]
10500 if __tmp.remaining() < Self::ENCODED_LEN {
10501 panic!(
10502 "buffer is too small (need {} bytes, but got {})",
10503 Self::ENCODED_LEN,
10504 __tmp.remaining(),
10505 )
10506 }
10507 __tmp.put_u32_le(self.size);
10508 __tmp.put_u16_le(self.width);
10509 __tmp.put_u16_le(self.height);
10510 __tmp.put_u16_le(self.packets);
10511 __tmp.put_u8(self.mavtype as u8);
10512 __tmp.put_u8(self.payload);
10513 __tmp.put_u8(self.jpg_quality);
10514 if matches!(version, MavlinkVersion::V2) {
10515 let len = __tmp.len();
10516 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10517 } else {
10518 __tmp.len()
10519 }
10520 }
10521}
10522#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10523#[doc = ""]
10524#[doc = "ID: 254"]
10525#[derive(Debug, Clone, PartialEq)]
10526#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10527#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10528#[cfg_attr(feature = "ts", derive(TS))]
10529#[cfg_attr(feature = "ts", ts(export))]
10530pub struct DEBUG_DATA {
10531 #[doc = "Timestamp (time since system boot)."]
10532 pub time_boot_ms: u32,
10533 #[doc = "DEBUG value"]
10534 pub value: f32,
10535 #[doc = "index of debug variable"]
10536 pub ind: u8,
10537}
10538impl DEBUG_DATA {
10539 pub const ENCODED_LEN: usize = 9usize;
10540 pub const DEFAULT: Self = Self {
10541 time_boot_ms: 0_u32,
10542 value: 0.0_f32,
10543 ind: 0_u8,
10544 };
10545 #[cfg(feature = "arbitrary")]
10546 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10547 use arbitrary::{Arbitrary, Unstructured};
10548 let mut buf = [0u8; 1024];
10549 rng.fill_bytes(&mut buf);
10550 let mut unstructured = Unstructured::new(&buf);
10551 Self::arbitrary(&mut unstructured).unwrap_or_default()
10552 }
10553}
10554impl Default for DEBUG_DATA {
10555 fn default() -> Self {
10556 Self::DEFAULT.clone()
10557 }
10558}
10559impl MessageData for DEBUG_DATA {
10560 type Message = MavMessage;
10561 const ID: u32 = 254u32;
10562 const NAME: &'static str = "DEBUG";
10563 const EXTRA_CRC: u8 = 46u8;
10564 const ENCODED_LEN: usize = 9usize;
10565 fn deser(
10566 _version: MavlinkVersion,
10567 __input: &[u8],
10568 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10569 let avail_len = __input.len();
10570 let mut payload_buf = [0; Self::ENCODED_LEN];
10571 let mut buf = if avail_len < Self::ENCODED_LEN {
10572 payload_buf[0..avail_len].copy_from_slice(__input);
10573 Bytes::new(&payload_buf)
10574 } else {
10575 Bytes::new(__input)
10576 };
10577 let mut __struct = Self::default();
10578 __struct.time_boot_ms = buf.get_u32_le();
10579 __struct.value = buf.get_f32_le();
10580 __struct.ind = buf.get_u8();
10581 Ok(__struct)
10582 }
10583 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10584 let mut __tmp = BytesMut::new(bytes);
10585 #[allow(clippy::absurd_extreme_comparisons)]
10586 #[allow(unused_comparisons)]
10587 if __tmp.remaining() < Self::ENCODED_LEN {
10588 panic!(
10589 "buffer is too small (need {} bytes, but got {})",
10590 Self::ENCODED_LEN,
10591 __tmp.remaining(),
10592 )
10593 }
10594 __tmp.put_u32_le(self.time_boot_ms);
10595 __tmp.put_f32_le(self.value);
10596 __tmp.put_u8(self.ind);
10597 if matches!(version, MavlinkVersion::V2) {
10598 let len = __tmp.len();
10599 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10600 } else {
10601 __tmp.len()
10602 }
10603 }
10604}
10605#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10606#[doc = ""]
10607#[doc = "ID: 350"]
10608#[derive(Debug, Clone, PartialEq)]
10609#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10610#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10611#[cfg_attr(feature = "ts", derive(TS))]
10612#[cfg_attr(feature = "ts", ts(export))]
10613pub struct DEBUG_FLOAT_ARRAY_DATA {
10614 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10615 pub time_usec: u64,
10616 #[doc = "Unique ID used to discriminate between arrays"]
10617 pub array_id: u16,
10618 #[doc = "Name, for human-friendly display in a Ground Control Station"]
10619 #[cfg_attr(feature = "ts", ts(type = "string"))]
10620 pub name: CharArray<10>,
10621 #[doc = "data"]
10622 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10623 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10624 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10625 pub data: [f32; 58],
10626}
10627impl DEBUG_FLOAT_ARRAY_DATA {
10628 pub const ENCODED_LEN: usize = 252usize;
10629 pub const DEFAULT: Self = Self {
10630 time_usec: 0_u64,
10631 array_id: 0_u16,
10632 name: CharArray::new([0_u8; 10usize]),
10633 data: [0.0_f32; 58usize],
10634 };
10635 #[cfg(feature = "arbitrary")]
10636 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10637 use arbitrary::{Arbitrary, Unstructured};
10638 let mut buf = [0u8; 1024];
10639 rng.fill_bytes(&mut buf);
10640 let mut unstructured = Unstructured::new(&buf);
10641 Self::arbitrary(&mut unstructured).unwrap_or_default()
10642 }
10643}
10644impl Default for DEBUG_FLOAT_ARRAY_DATA {
10645 fn default() -> Self {
10646 Self::DEFAULT.clone()
10647 }
10648}
10649impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10650 type Message = MavMessage;
10651 const ID: u32 = 350u32;
10652 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10653 const EXTRA_CRC: u8 = 232u8;
10654 const ENCODED_LEN: usize = 252usize;
10655 fn deser(
10656 _version: MavlinkVersion,
10657 __input: &[u8],
10658 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10659 let avail_len = __input.len();
10660 let mut payload_buf = [0; Self::ENCODED_LEN];
10661 let mut buf = if avail_len < Self::ENCODED_LEN {
10662 payload_buf[0..avail_len].copy_from_slice(__input);
10663 Bytes::new(&payload_buf)
10664 } else {
10665 Bytes::new(__input)
10666 };
10667 let mut __struct = Self::default();
10668 __struct.time_usec = buf.get_u64_le();
10669 __struct.array_id = buf.get_u16_le();
10670 let mut tmp = [0_u8; 10usize];
10671 for v in &mut tmp {
10672 *v = buf.get_u8();
10673 }
10674 __struct.name = CharArray::new(tmp);
10675 for v in &mut __struct.data {
10676 let val = buf.get_f32_le();
10677 *v = val;
10678 }
10679 Ok(__struct)
10680 }
10681 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10682 let mut __tmp = BytesMut::new(bytes);
10683 #[allow(clippy::absurd_extreme_comparisons)]
10684 #[allow(unused_comparisons)]
10685 if __tmp.remaining() < Self::ENCODED_LEN {
10686 panic!(
10687 "buffer is too small (need {} bytes, but got {})",
10688 Self::ENCODED_LEN,
10689 __tmp.remaining(),
10690 )
10691 }
10692 __tmp.put_u64_le(self.time_usec);
10693 __tmp.put_u16_le(self.array_id);
10694 for val in &self.name {
10695 __tmp.put_u8(*val);
10696 }
10697 if matches!(version, MavlinkVersion::V2) {
10698 for val in &self.data {
10699 __tmp.put_f32_le(*val);
10700 }
10701 let len = __tmp.len();
10702 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10703 } else {
10704 __tmp.len()
10705 }
10706 }
10707}
10708#[doc = "To debug something using a named 3D vector."]
10709#[doc = ""]
10710#[doc = "ID: 250"]
10711#[derive(Debug, Clone, PartialEq)]
10712#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10713#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10714#[cfg_attr(feature = "ts", derive(TS))]
10715#[cfg_attr(feature = "ts", ts(export))]
10716pub struct DEBUG_VECT_DATA {
10717 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10718 pub time_usec: u64,
10719 #[doc = "x"]
10720 pub x: f32,
10721 #[doc = "y"]
10722 pub y: f32,
10723 #[doc = "z"]
10724 pub z: f32,
10725 #[doc = "Name"]
10726 #[cfg_attr(feature = "ts", ts(type = "string"))]
10727 pub name: CharArray<10>,
10728}
10729impl DEBUG_VECT_DATA {
10730 pub const ENCODED_LEN: usize = 30usize;
10731 pub const DEFAULT: Self = Self {
10732 time_usec: 0_u64,
10733 x: 0.0_f32,
10734 y: 0.0_f32,
10735 z: 0.0_f32,
10736 name: CharArray::new([0_u8; 10usize]),
10737 };
10738 #[cfg(feature = "arbitrary")]
10739 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10740 use arbitrary::{Arbitrary, Unstructured};
10741 let mut buf = [0u8; 1024];
10742 rng.fill_bytes(&mut buf);
10743 let mut unstructured = Unstructured::new(&buf);
10744 Self::arbitrary(&mut unstructured).unwrap_or_default()
10745 }
10746}
10747impl Default for DEBUG_VECT_DATA {
10748 fn default() -> Self {
10749 Self::DEFAULT.clone()
10750 }
10751}
10752impl MessageData for DEBUG_VECT_DATA {
10753 type Message = MavMessage;
10754 const ID: u32 = 250u32;
10755 const NAME: &'static str = "DEBUG_VECT";
10756 const EXTRA_CRC: u8 = 49u8;
10757 const ENCODED_LEN: usize = 30usize;
10758 fn deser(
10759 _version: MavlinkVersion,
10760 __input: &[u8],
10761 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10762 let avail_len = __input.len();
10763 let mut payload_buf = [0; Self::ENCODED_LEN];
10764 let mut buf = if avail_len < Self::ENCODED_LEN {
10765 payload_buf[0..avail_len].copy_from_slice(__input);
10766 Bytes::new(&payload_buf)
10767 } else {
10768 Bytes::new(__input)
10769 };
10770 let mut __struct = Self::default();
10771 __struct.time_usec = buf.get_u64_le();
10772 __struct.x = buf.get_f32_le();
10773 __struct.y = buf.get_f32_le();
10774 __struct.z = buf.get_f32_le();
10775 let mut tmp = [0_u8; 10usize];
10776 for v in &mut tmp {
10777 *v = buf.get_u8();
10778 }
10779 __struct.name = CharArray::new(tmp);
10780 Ok(__struct)
10781 }
10782 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10783 let mut __tmp = BytesMut::new(bytes);
10784 #[allow(clippy::absurd_extreme_comparisons)]
10785 #[allow(unused_comparisons)]
10786 if __tmp.remaining() < Self::ENCODED_LEN {
10787 panic!(
10788 "buffer is too small (need {} bytes, but got {})",
10789 Self::ENCODED_LEN,
10790 __tmp.remaining(),
10791 )
10792 }
10793 __tmp.put_u64_le(self.time_usec);
10794 __tmp.put_f32_le(self.x);
10795 __tmp.put_f32_le(self.y);
10796 __tmp.put_f32_le(self.z);
10797 for val in &self.name {
10798 __tmp.put_u8(*val);
10799 }
10800 if matches!(version, MavlinkVersion::V2) {
10801 let len = __tmp.len();
10802 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10803 } else {
10804 __tmp.len()
10805 }
10806 }
10807}
10808#[doc = "Distance sensor information for an onboard rangefinder."]
10809#[doc = ""]
10810#[doc = "ID: 132"]
10811#[derive(Debug, Clone, PartialEq)]
10812#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10813#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10814#[cfg_attr(feature = "ts", derive(TS))]
10815#[cfg_attr(feature = "ts", ts(export))]
10816pub struct DISTANCE_SENSOR_DATA {
10817 #[doc = "Timestamp (time since system boot)."]
10818 pub time_boot_ms: u32,
10819 #[doc = "Minimum distance the sensor can measure"]
10820 pub min_distance: u16,
10821 #[doc = "Maximum distance the sensor can measure"]
10822 pub max_distance: u16,
10823 #[doc = "Current distance reading"]
10824 pub current_distance: u16,
10825 #[doc = "Type of distance sensor."]
10826 pub mavtype: MavDistanceSensor,
10827 #[doc = "Onboard ID of the sensor"]
10828 pub id: u8,
10829 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10830 pub orientation: MavSensorOrientation,
10831 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10832 pub covariance: u8,
10833 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10834 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10835 pub horizontal_fov: f32,
10836 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10837 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10838 pub vertical_fov: f32,
10839 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10840 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10841 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10842 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10843 pub quaternion: [f32; 4],
10844 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10845 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10846 pub signal_quality: u8,
10847}
10848impl DISTANCE_SENSOR_DATA {
10849 pub const ENCODED_LEN: usize = 39usize;
10850 pub const DEFAULT: Self = Self {
10851 time_boot_ms: 0_u32,
10852 min_distance: 0_u16,
10853 max_distance: 0_u16,
10854 current_distance: 0_u16,
10855 mavtype: MavDistanceSensor::DEFAULT,
10856 id: 0_u8,
10857 orientation: MavSensorOrientation::DEFAULT,
10858 covariance: 0_u8,
10859 horizontal_fov: 0.0_f32,
10860 vertical_fov: 0.0_f32,
10861 quaternion: [0.0_f32; 4usize],
10862 signal_quality: 0_u8,
10863 };
10864 #[cfg(feature = "arbitrary")]
10865 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10866 use arbitrary::{Arbitrary, Unstructured};
10867 let mut buf = [0u8; 1024];
10868 rng.fill_bytes(&mut buf);
10869 let mut unstructured = Unstructured::new(&buf);
10870 Self::arbitrary(&mut unstructured).unwrap_or_default()
10871 }
10872}
10873impl Default for DISTANCE_SENSOR_DATA {
10874 fn default() -> Self {
10875 Self::DEFAULT.clone()
10876 }
10877}
10878impl MessageData for DISTANCE_SENSOR_DATA {
10879 type Message = MavMessage;
10880 const ID: u32 = 132u32;
10881 const NAME: &'static str = "DISTANCE_SENSOR";
10882 const EXTRA_CRC: u8 = 85u8;
10883 const ENCODED_LEN: usize = 39usize;
10884 fn deser(
10885 _version: MavlinkVersion,
10886 __input: &[u8],
10887 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10888 let avail_len = __input.len();
10889 let mut payload_buf = [0; Self::ENCODED_LEN];
10890 let mut buf = if avail_len < Self::ENCODED_LEN {
10891 payload_buf[0..avail_len].copy_from_slice(__input);
10892 Bytes::new(&payload_buf)
10893 } else {
10894 Bytes::new(__input)
10895 };
10896 let mut __struct = Self::default();
10897 __struct.time_boot_ms = buf.get_u32_le();
10898 __struct.min_distance = buf.get_u16_le();
10899 __struct.max_distance = buf.get_u16_le();
10900 __struct.current_distance = buf.get_u16_le();
10901 let tmp = buf.get_u8();
10902 __struct.mavtype =
10903 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10904 enum_type: "MavDistanceSensor",
10905 value: tmp as u64,
10906 })?;
10907 __struct.id = buf.get_u8();
10908 let tmp = buf.get_u8();
10909 __struct.orientation =
10910 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10911 enum_type: "MavSensorOrientation",
10912 value: tmp as u64,
10913 })?;
10914 __struct.covariance = buf.get_u8();
10915 __struct.horizontal_fov = buf.get_f32_le();
10916 __struct.vertical_fov = buf.get_f32_le();
10917 for v in &mut __struct.quaternion {
10918 let val = buf.get_f32_le();
10919 *v = val;
10920 }
10921 __struct.signal_quality = buf.get_u8();
10922 Ok(__struct)
10923 }
10924 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10925 let mut __tmp = BytesMut::new(bytes);
10926 #[allow(clippy::absurd_extreme_comparisons)]
10927 #[allow(unused_comparisons)]
10928 if __tmp.remaining() < Self::ENCODED_LEN {
10929 panic!(
10930 "buffer is too small (need {} bytes, but got {})",
10931 Self::ENCODED_LEN,
10932 __tmp.remaining(),
10933 )
10934 }
10935 __tmp.put_u32_le(self.time_boot_ms);
10936 __tmp.put_u16_le(self.min_distance);
10937 __tmp.put_u16_le(self.max_distance);
10938 __tmp.put_u16_le(self.current_distance);
10939 __tmp.put_u8(self.mavtype as u8);
10940 __tmp.put_u8(self.id);
10941 __tmp.put_u8(self.orientation as u8);
10942 __tmp.put_u8(self.covariance);
10943 if matches!(version, MavlinkVersion::V2) {
10944 __tmp.put_f32_le(self.horizontal_fov);
10945 __tmp.put_f32_le(self.vertical_fov);
10946 for val in &self.quaternion {
10947 __tmp.put_f32_le(*val);
10948 }
10949 __tmp.put_u8(self.signal_quality);
10950 let len = __tmp.len();
10951 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10952 } else {
10953 __tmp.len()
10954 }
10955 }
10956}
10957#[doc = "EFI status output."]
10958#[doc = ""]
10959#[doc = "ID: 225"]
10960#[derive(Debug, Clone, PartialEq)]
10961#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10962#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10963#[cfg_attr(feature = "ts", derive(TS))]
10964#[cfg_attr(feature = "ts", ts(export))]
10965pub struct EFI_STATUS_DATA {
10966 #[doc = "ECU index"]
10967 pub ecu_index: f32,
10968 #[doc = "RPM"]
10969 pub rpm: f32,
10970 #[doc = "Fuel consumed"]
10971 pub fuel_consumed: f32,
10972 #[doc = "Fuel flow rate"]
10973 pub fuel_flow: f32,
10974 #[doc = "Engine load"]
10975 pub engine_load: f32,
10976 #[doc = "Throttle position"]
10977 pub throttle_position: f32,
10978 #[doc = "Spark dwell time"]
10979 pub spark_dwell_time: f32,
10980 #[doc = "Barometric pressure"]
10981 pub barometric_pressure: f32,
10982 #[doc = "Intake manifold pressure("]
10983 pub intake_manifold_pressure: f32,
10984 #[doc = "Intake manifold temperature"]
10985 pub intake_manifold_temperature: f32,
10986 #[doc = "Cylinder head temperature"]
10987 pub cylinder_head_temperature: f32,
10988 #[doc = "Ignition timing (Crank angle degrees)"]
10989 pub ignition_timing: f32,
10990 #[doc = "Injection time"]
10991 pub injection_time: f32,
10992 #[doc = "Exhaust gas temperature"]
10993 pub exhaust_gas_temperature: f32,
10994 #[doc = "Output throttle"]
10995 pub throttle_out: f32,
10996 #[doc = "Pressure/temperature compensation"]
10997 pub pt_compensation: f32,
10998 #[doc = "EFI health status"]
10999 pub health: u8,
11000 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
11001 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11002 pub ignition_voltage: f32,
11003 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
11004 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11005 pub fuel_pressure: f32,
11006}
11007impl EFI_STATUS_DATA {
11008 pub const ENCODED_LEN: usize = 73usize;
11009 pub const DEFAULT: Self = Self {
11010 ecu_index: 0.0_f32,
11011 rpm: 0.0_f32,
11012 fuel_consumed: 0.0_f32,
11013 fuel_flow: 0.0_f32,
11014 engine_load: 0.0_f32,
11015 throttle_position: 0.0_f32,
11016 spark_dwell_time: 0.0_f32,
11017 barometric_pressure: 0.0_f32,
11018 intake_manifold_pressure: 0.0_f32,
11019 intake_manifold_temperature: 0.0_f32,
11020 cylinder_head_temperature: 0.0_f32,
11021 ignition_timing: 0.0_f32,
11022 injection_time: 0.0_f32,
11023 exhaust_gas_temperature: 0.0_f32,
11024 throttle_out: 0.0_f32,
11025 pt_compensation: 0.0_f32,
11026 health: 0_u8,
11027 ignition_voltage: 0.0_f32,
11028 fuel_pressure: 0.0_f32,
11029 };
11030 #[cfg(feature = "arbitrary")]
11031 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11032 use arbitrary::{Arbitrary, Unstructured};
11033 let mut buf = [0u8; 1024];
11034 rng.fill_bytes(&mut buf);
11035 let mut unstructured = Unstructured::new(&buf);
11036 Self::arbitrary(&mut unstructured).unwrap_or_default()
11037 }
11038}
11039impl Default for EFI_STATUS_DATA {
11040 fn default() -> Self {
11041 Self::DEFAULT.clone()
11042 }
11043}
11044impl MessageData for EFI_STATUS_DATA {
11045 type Message = MavMessage;
11046 const ID: u32 = 225u32;
11047 const NAME: &'static str = "EFI_STATUS";
11048 const EXTRA_CRC: u8 = 208u8;
11049 const ENCODED_LEN: usize = 73usize;
11050 fn deser(
11051 _version: MavlinkVersion,
11052 __input: &[u8],
11053 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11054 let avail_len = __input.len();
11055 let mut payload_buf = [0; Self::ENCODED_LEN];
11056 let mut buf = if avail_len < Self::ENCODED_LEN {
11057 payload_buf[0..avail_len].copy_from_slice(__input);
11058 Bytes::new(&payload_buf)
11059 } else {
11060 Bytes::new(__input)
11061 };
11062 let mut __struct = Self::default();
11063 __struct.ecu_index = buf.get_f32_le();
11064 __struct.rpm = buf.get_f32_le();
11065 __struct.fuel_consumed = buf.get_f32_le();
11066 __struct.fuel_flow = buf.get_f32_le();
11067 __struct.engine_load = buf.get_f32_le();
11068 __struct.throttle_position = buf.get_f32_le();
11069 __struct.spark_dwell_time = buf.get_f32_le();
11070 __struct.barometric_pressure = buf.get_f32_le();
11071 __struct.intake_manifold_pressure = buf.get_f32_le();
11072 __struct.intake_manifold_temperature = buf.get_f32_le();
11073 __struct.cylinder_head_temperature = buf.get_f32_le();
11074 __struct.ignition_timing = buf.get_f32_le();
11075 __struct.injection_time = buf.get_f32_le();
11076 __struct.exhaust_gas_temperature = buf.get_f32_le();
11077 __struct.throttle_out = buf.get_f32_le();
11078 __struct.pt_compensation = buf.get_f32_le();
11079 __struct.health = buf.get_u8();
11080 __struct.ignition_voltage = buf.get_f32_le();
11081 __struct.fuel_pressure = buf.get_f32_le();
11082 Ok(__struct)
11083 }
11084 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11085 let mut __tmp = BytesMut::new(bytes);
11086 #[allow(clippy::absurd_extreme_comparisons)]
11087 #[allow(unused_comparisons)]
11088 if __tmp.remaining() < Self::ENCODED_LEN {
11089 panic!(
11090 "buffer is too small (need {} bytes, but got {})",
11091 Self::ENCODED_LEN,
11092 __tmp.remaining(),
11093 )
11094 }
11095 __tmp.put_f32_le(self.ecu_index);
11096 __tmp.put_f32_le(self.rpm);
11097 __tmp.put_f32_le(self.fuel_consumed);
11098 __tmp.put_f32_le(self.fuel_flow);
11099 __tmp.put_f32_le(self.engine_load);
11100 __tmp.put_f32_le(self.throttle_position);
11101 __tmp.put_f32_le(self.spark_dwell_time);
11102 __tmp.put_f32_le(self.barometric_pressure);
11103 __tmp.put_f32_le(self.intake_manifold_pressure);
11104 __tmp.put_f32_le(self.intake_manifold_temperature);
11105 __tmp.put_f32_le(self.cylinder_head_temperature);
11106 __tmp.put_f32_le(self.ignition_timing);
11107 __tmp.put_f32_le(self.injection_time);
11108 __tmp.put_f32_le(self.exhaust_gas_temperature);
11109 __tmp.put_f32_le(self.throttle_out);
11110 __tmp.put_f32_le(self.pt_compensation);
11111 __tmp.put_u8(self.health);
11112 if matches!(version, MavlinkVersion::V2) {
11113 __tmp.put_f32_le(self.ignition_voltage);
11114 __tmp.put_f32_le(self.fuel_pressure);
11115 let len = __tmp.len();
11116 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11117 } else {
11118 __tmp.len()
11119 }
11120 }
11121}
11122#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
11123#[doc = ""]
11124#[doc = "ID: 131"]
11125#[derive(Debug, Clone, PartialEq)]
11126#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11127#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11128#[cfg_attr(feature = "ts", derive(TS))]
11129#[cfg_attr(feature = "ts", ts(export))]
11130pub struct ENCAPSULATED_DATA_DATA {
11131 #[doc = "sequence number (starting with 0 on every transmission)"]
11132 pub seqnr: u16,
11133 #[doc = "image data bytes"]
11134 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11135 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11136 pub data: [u8; 253],
11137}
11138impl ENCAPSULATED_DATA_DATA {
11139 pub const ENCODED_LEN: usize = 255usize;
11140 pub const DEFAULT: Self = Self {
11141 seqnr: 0_u16,
11142 data: [0_u8; 253usize],
11143 };
11144 #[cfg(feature = "arbitrary")]
11145 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11146 use arbitrary::{Arbitrary, Unstructured};
11147 let mut buf = [0u8; 1024];
11148 rng.fill_bytes(&mut buf);
11149 let mut unstructured = Unstructured::new(&buf);
11150 Self::arbitrary(&mut unstructured).unwrap_or_default()
11151 }
11152}
11153impl Default for ENCAPSULATED_DATA_DATA {
11154 fn default() -> Self {
11155 Self::DEFAULT.clone()
11156 }
11157}
11158impl MessageData for ENCAPSULATED_DATA_DATA {
11159 type Message = MavMessage;
11160 const ID: u32 = 131u32;
11161 const NAME: &'static str = "ENCAPSULATED_DATA";
11162 const EXTRA_CRC: u8 = 223u8;
11163 const ENCODED_LEN: usize = 255usize;
11164 fn deser(
11165 _version: MavlinkVersion,
11166 __input: &[u8],
11167 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11168 let avail_len = __input.len();
11169 let mut payload_buf = [0; Self::ENCODED_LEN];
11170 let mut buf = if avail_len < Self::ENCODED_LEN {
11171 payload_buf[0..avail_len].copy_from_slice(__input);
11172 Bytes::new(&payload_buf)
11173 } else {
11174 Bytes::new(__input)
11175 };
11176 let mut __struct = Self::default();
11177 __struct.seqnr = buf.get_u16_le();
11178 for v in &mut __struct.data {
11179 let val = buf.get_u8();
11180 *v = val;
11181 }
11182 Ok(__struct)
11183 }
11184 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11185 let mut __tmp = BytesMut::new(bytes);
11186 #[allow(clippy::absurd_extreme_comparisons)]
11187 #[allow(unused_comparisons)]
11188 if __tmp.remaining() < Self::ENCODED_LEN {
11189 panic!(
11190 "buffer is too small (need {} bytes, but got {})",
11191 Self::ENCODED_LEN,
11192 __tmp.remaining(),
11193 )
11194 }
11195 __tmp.put_u16_le(self.seqnr);
11196 for val in &self.data {
11197 __tmp.put_u8(*val);
11198 }
11199 if matches!(version, MavlinkVersion::V2) {
11200 let len = __tmp.len();
11201 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11202 } else {
11203 __tmp.len()
11204 }
11205 }
11206}
11207#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
11208#[doc = ""]
11209#[doc = "ID: 290"]
11210#[derive(Debug, Clone, PartialEq)]
11211#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11212#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11213#[cfg_attr(feature = "ts", derive(TS))]
11214#[cfg_attr(feature = "ts", ts(export))]
11215pub struct ESC_INFO_DATA {
11216 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11217 pub time_usec: u64,
11218 #[doc = "Number of reported errors by each ESC since boot."]
11219 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11220 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11221 pub error_count: [u32; 4],
11222 #[doc = "Counter of data packets received."]
11223 pub counter: u16,
11224 #[doc = "Bitmap of ESC failure flags."]
11225 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11226 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11227 pub failure_flags: [u16; 4],
11228 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
11229 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11230 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11231 pub temperature: [i16; 4],
11232 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11233 pub index: u8,
11234 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
11235 pub count: u8,
11236 #[doc = "Connection type protocol for all ESC."]
11237 pub connection_type: EscConnectionType,
11238 #[doc = "Information regarding online/offline status of each ESC."]
11239 pub info: u8,
11240}
11241impl ESC_INFO_DATA {
11242 pub const ENCODED_LEN: usize = 46usize;
11243 pub const DEFAULT: Self = Self {
11244 time_usec: 0_u64,
11245 error_count: [0_u32; 4usize],
11246 counter: 0_u16,
11247 failure_flags: [0_u16; 4usize],
11248 temperature: [0_i16; 4usize],
11249 index: 0_u8,
11250 count: 0_u8,
11251 connection_type: EscConnectionType::DEFAULT,
11252 info: 0_u8,
11253 };
11254 #[cfg(feature = "arbitrary")]
11255 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11256 use arbitrary::{Arbitrary, Unstructured};
11257 let mut buf = [0u8; 1024];
11258 rng.fill_bytes(&mut buf);
11259 let mut unstructured = Unstructured::new(&buf);
11260 Self::arbitrary(&mut unstructured).unwrap_or_default()
11261 }
11262}
11263impl Default for ESC_INFO_DATA {
11264 fn default() -> Self {
11265 Self::DEFAULT.clone()
11266 }
11267}
11268impl MessageData for ESC_INFO_DATA {
11269 type Message = MavMessage;
11270 const ID: u32 = 290u32;
11271 const NAME: &'static str = "ESC_INFO";
11272 const EXTRA_CRC: u8 = 251u8;
11273 const ENCODED_LEN: usize = 46usize;
11274 fn deser(
11275 _version: MavlinkVersion,
11276 __input: &[u8],
11277 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11278 let avail_len = __input.len();
11279 let mut payload_buf = [0; Self::ENCODED_LEN];
11280 let mut buf = if avail_len < Self::ENCODED_LEN {
11281 payload_buf[0..avail_len].copy_from_slice(__input);
11282 Bytes::new(&payload_buf)
11283 } else {
11284 Bytes::new(__input)
11285 };
11286 let mut __struct = Self::default();
11287 __struct.time_usec = buf.get_u64_le();
11288 for v in &mut __struct.error_count {
11289 let val = buf.get_u32_le();
11290 *v = val;
11291 }
11292 __struct.counter = buf.get_u16_le();
11293 for v in &mut __struct.failure_flags {
11294 let val = buf.get_u16_le();
11295 *v = val;
11296 }
11297 for v in &mut __struct.temperature {
11298 let val = buf.get_i16_le();
11299 *v = val;
11300 }
11301 __struct.index = buf.get_u8();
11302 __struct.count = buf.get_u8();
11303 let tmp = buf.get_u8();
11304 __struct.connection_type =
11305 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11306 enum_type: "EscConnectionType",
11307 value: tmp as u64,
11308 })?;
11309 __struct.info = buf.get_u8();
11310 Ok(__struct)
11311 }
11312 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11313 let mut __tmp = BytesMut::new(bytes);
11314 #[allow(clippy::absurd_extreme_comparisons)]
11315 #[allow(unused_comparisons)]
11316 if __tmp.remaining() < Self::ENCODED_LEN {
11317 panic!(
11318 "buffer is too small (need {} bytes, but got {})",
11319 Self::ENCODED_LEN,
11320 __tmp.remaining(),
11321 )
11322 }
11323 __tmp.put_u64_le(self.time_usec);
11324 for val in &self.error_count {
11325 __tmp.put_u32_le(*val);
11326 }
11327 __tmp.put_u16_le(self.counter);
11328 for val in &self.failure_flags {
11329 __tmp.put_u16_le(*val);
11330 }
11331 for val in &self.temperature {
11332 __tmp.put_i16_le(*val);
11333 }
11334 __tmp.put_u8(self.index);
11335 __tmp.put_u8(self.count);
11336 __tmp.put_u8(self.connection_type as u8);
11337 __tmp.put_u8(self.info);
11338 if matches!(version, MavlinkVersion::V2) {
11339 let len = __tmp.len();
11340 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11341 } else {
11342 __tmp.len()
11343 }
11344 }
11345}
11346#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
11347#[doc = ""]
11348#[doc = "ID: 291"]
11349#[derive(Debug, Clone, PartialEq)]
11350#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11351#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11352#[cfg_attr(feature = "ts", derive(TS))]
11353#[cfg_attr(feature = "ts", ts(export))]
11354pub struct ESC_STATUS_DATA {
11355 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11356 pub time_usec: u64,
11357 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
11358 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11359 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11360 pub rpm: [i32; 4],
11361 #[doc = "Voltage measured from each ESC."]
11362 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11363 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11364 pub voltage: [f32; 4],
11365 #[doc = "Current measured from each ESC."]
11366 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11367 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11368 pub current: [f32; 4],
11369 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11370 pub index: u8,
11371}
11372impl ESC_STATUS_DATA {
11373 pub const ENCODED_LEN: usize = 57usize;
11374 pub const DEFAULT: Self = Self {
11375 time_usec: 0_u64,
11376 rpm: [0_i32; 4usize],
11377 voltage: [0.0_f32; 4usize],
11378 current: [0.0_f32; 4usize],
11379 index: 0_u8,
11380 };
11381 #[cfg(feature = "arbitrary")]
11382 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11383 use arbitrary::{Arbitrary, Unstructured};
11384 let mut buf = [0u8; 1024];
11385 rng.fill_bytes(&mut buf);
11386 let mut unstructured = Unstructured::new(&buf);
11387 Self::arbitrary(&mut unstructured).unwrap_or_default()
11388 }
11389}
11390impl Default for ESC_STATUS_DATA {
11391 fn default() -> Self {
11392 Self::DEFAULT.clone()
11393 }
11394}
11395impl MessageData for ESC_STATUS_DATA {
11396 type Message = MavMessage;
11397 const ID: u32 = 291u32;
11398 const NAME: &'static str = "ESC_STATUS";
11399 const EXTRA_CRC: u8 = 10u8;
11400 const ENCODED_LEN: usize = 57usize;
11401 fn deser(
11402 _version: MavlinkVersion,
11403 __input: &[u8],
11404 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11405 let avail_len = __input.len();
11406 let mut payload_buf = [0; Self::ENCODED_LEN];
11407 let mut buf = if avail_len < Self::ENCODED_LEN {
11408 payload_buf[0..avail_len].copy_from_slice(__input);
11409 Bytes::new(&payload_buf)
11410 } else {
11411 Bytes::new(__input)
11412 };
11413 let mut __struct = Self::default();
11414 __struct.time_usec = buf.get_u64_le();
11415 for v in &mut __struct.rpm {
11416 let val = buf.get_i32_le();
11417 *v = val;
11418 }
11419 for v in &mut __struct.voltage {
11420 let val = buf.get_f32_le();
11421 *v = val;
11422 }
11423 for v in &mut __struct.current {
11424 let val = buf.get_f32_le();
11425 *v = val;
11426 }
11427 __struct.index = buf.get_u8();
11428 Ok(__struct)
11429 }
11430 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11431 let mut __tmp = BytesMut::new(bytes);
11432 #[allow(clippy::absurd_extreme_comparisons)]
11433 #[allow(unused_comparisons)]
11434 if __tmp.remaining() < Self::ENCODED_LEN {
11435 panic!(
11436 "buffer is too small (need {} bytes, but got {})",
11437 Self::ENCODED_LEN,
11438 __tmp.remaining(),
11439 )
11440 }
11441 __tmp.put_u64_le(self.time_usec);
11442 for val in &self.rpm {
11443 __tmp.put_i32_le(*val);
11444 }
11445 for val in &self.voltage {
11446 __tmp.put_f32_le(*val);
11447 }
11448 for val in &self.current {
11449 __tmp.put_f32_le(*val);
11450 }
11451 __tmp.put_u8(self.index);
11452 if matches!(version, MavlinkVersion::V2) {
11453 let len = __tmp.len();
11454 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11455 } else {
11456 __tmp.len()
11457 }
11458 }
11459}
11460#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
11461#[doc = ""]
11462#[doc = "ID: 230"]
11463#[derive(Debug, Clone, PartialEq)]
11464#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11465#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11466#[cfg_attr(feature = "ts", derive(TS))]
11467#[cfg_attr(feature = "ts", ts(export))]
11468pub struct ESTIMATOR_STATUS_DATA {
11469 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11470 pub time_usec: u64,
11471 #[doc = "Velocity innovation test ratio"]
11472 pub vel_ratio: f32,
11473 #[doc = "Horizontal position innovation test ratio"]
11474 pub pos_horiz_ratio: f32,
11475 #[doc = "Vertical position innovation test ratio"]
11476 pub pos_vert_ratio: f32,
11477 #[doc = "Magnetometer innovation test ratio"]
11478 pub mag_ratio: f32,
11479 #[doc = "Height above terrain innovation test ratio"]
11480 pub hagl_ratio: f32,
11481 #[doc = "True airspeed innovation test ratio"]
11482 pub tas_ratio: f32,
11483 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
11484 pub pos_horiz_accuracy: f32,
11485 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
11486 pub pos_vert_accuracy: f32,
11487 #[doc = "Bitmap indicating which EKF outputs are valid."]
11488 pub flags: EstimatorStatusFlags,
11489}
11490impl ESTIMATOR_STATUS_DATA {
11491 pub const ENCODED_LEN: usize = 42usize;
11492 pub const DEFAULT: Self = Self {
11493 time_usec: 0_u64,
11494 vel_ratio: 0.0_f32,
11495 pos_horiz_ratio: 0.0_f32,
11496 pos_vert_ratio: 0.0_f32,
11497 mag_ratio: 0.0_f32,
11498 hagl_ratio: 0.0_f32,
11499 tas_ratio: 0.0_f32,
11500 pos_horiz_accuracy: 0.0_f32,
11501 pos_vert_accuracy: 0.0_f32,
11502 flags: EstimatorStatusFlags::DEFAULT,
11503 };
11504 #[cfg(feature = "arbitrary")]
11505 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11506 use arbitrary::{Arbitrary, Unstructured};
11507 let mut buf = [0u8; 1024];
11508 rng.fill_bytes(&mut buf);
11509 let mut unstructured = Unstructured::new(&buf);
11510 Self::arbitrary(&mut unstructured).unwrap_or_default()
11511 }
11512}
11513impl Default for ESTIMATOR_STATUS_DATA {
11514 fn default() -> Self {
11515 Self::DEFAULT.clone()
11516 }
11517}
11518impl MessageData for ESTIMATOR_STATUS_DATA {
11519 type Message = MavMessage;
11520 const ID: u32 = 230u32;
11521 const NAME: &'static str = "ESTIMATOR_STATUS";
11522 const EXTRA_CRC: u8 = 163u8;
11523 const ENCODED_LEN: usize = 42usize;
11524 fn deser(
11525 _version: MavlinkVersion,
11526 __input: &[u8],
11527 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11528 let avail_len = __input.len();
11529 let mut payload_buf = [0; Self::ENCODED_LEN];
11530 let mut buf = if avail_len < Self::ENCODED_LEN {
11531 payload_buf[0..avail_len].copy_from_slice(__input);
11532 Bytes::new(&payload_buf)
11533 } else {
11534 Bytes::new(__input)
11535 };
11536 let mut __struct = Self::default();
11537 __struct.time_usec = buf.get_u64_le();
11538 __struct.vel_ratio = buf.get_f32_le();
11539 __struct.pos_horiz_ratio = buf.get_f32_le();
11540 __struct.pos_vert_ratio = buf.get_f32_le();
11541 __struct.mag_ratio = buf.get_f32_le();
11542 __struct.hagl_ratio = buf.get_f32_le();
11543 __struct.tas_ratio = buf.get_f32_le();
11544 __struct.pos_horiz_accuracy = buf.get_f32_le();
11545 __struct.pos_vert_accuracy = buf.get_f32_le();
11546 let tmp = buf.get_u16_le();
11547 __struct.flags = EstimatorStatusFlags::from_bits(
11548 tmp as <EstimatorStatusFlags as Flags>::Bits,
11549 )
11550 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11551 flag_type: "EstimatorStatusFlags",
11552 value: tmp as u64,
11553 })?;
11554 Ok(__struct)
11555 }
11556 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11557 let mut __tmp = BytesMut::new(bytes);
11558 #[allow(clippy::absurd_extreme_comparisons)]
11559 #[allow(unused_comparisons)]
11560 if __tmp.remaining() < Self::ENCODED_LEN {
11561 panic!(
11562 "buffer is too small (need {} bytes, but got {})",
11563 Self::ENCODED_LEN,
11564 __tmp.remaining(),
11565 )
11566 }
11567 __tmp.put_u64_le(self.time_usec);
11568 __tmp.put_f32_le(self.vel_ratio);
11569 __tmp.put_f32_le(self.pos_horiz_ratio);
11570 __tmp.put_f32_le(self.pos_vert_ratio);
11571 __tmp.put_f32_le(self.mag_ratio);
11572 __tmp.put_f32_le(self.hagl_ratio);
11573 __tmp.put_f32_le(self.tas_ratio);
11574 __tmp.put_f32_le(self.pos_horiz_accuracy);
11575 __tmp.put_f32_le(self.pos_vert_accuracy);
11576 __tmp.put_u16_le(self.flags.bits() as u16);
11577 if matches!(version, MavlinkVersion::V2) {
11578 let len = __tmp.len();
11579 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11580 } else {
11581 __tmp.len()
11582 }
11583 }
11584}
11585#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11586#[doc = ""]
11587#[doc = "ID: 410"]
11588#[derive(Debug, Clone, PartialEq)]
11589#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11590#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11591#[cfg_attr(feature = "ts", derive(TS))]
11592#[cfg_attr(feature = "ts", ts(export))]
11593pub struct EVENT_DATA {
11594 #[doc = "Event ID (as defined in the component metadata)"]
11595 pub id: u32,
11596 #[doc = "Timestamp (time since system boot when the event happened)."]
11597 pub event_time_boot_ms: u32,
11598 #[doc = "Sequence number."]
11599 pub sequence: u16,
11600 #[doc = "Component ID"]
11601 pub destination_component: u8,
11602 #[doc = "System ID"]
11603 pub destination_system: u8,
11604 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
11605 pub log_levels: u8,
11606 #[doc = "Arguments (depend on event ID)."]
11607 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11608 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11609 pub arguments: [u8; 40],
11610}
11611impl EVENT_DATA {
11612 pub const ENCODED_LEN: usize = 53usize;
11613 pub const DEFAULT: Self = Self {
11614 id: 0_u32,
11615 event_time_boot_ms: 0_u32,
11616 sequence: 0_u16,
11617 destination_component: 0_u8,
11618 destination_system: 0_u8,
11619 log_levels: 0_u8,
11620 arguments: [0_u8; 40usize],
11621 };
11622 #[cfg(feature = "arbitrary")]
11623 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11624 use arbitrary::{Arbitrary, Unstructured};
11625 let mut buf = [0u8; 1024];
11626 rng.fill_bytes(&mut buf);
11627 let mut unstructured = Unstructured::new(&buf);
11628 Self::arbitrary(&mut unstructured).unwrap_or_default()
11629 }
11630}
11631impl Default for EVENT_DATA {
11632 fn default() -> Self {
11633 Self::DEFAULT.clone()
11634 }
11635}
11636impl MessageData for EVENT_DATA {
11637 type Message = MavMessage;
11638 const ID: u32 = 410u32;
11639 const NAME: &'static str = "EVENT";
11640 const EXTRA_CRC: u8 = 160u8;
11641 const ENCODED_LEN: usize = 53usize;
11642 fn deser(
11643 _version: MavlinkVersion,
11644 __input: &[u8],
11645 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11646 let avail_len = __input.len();
11647 let mut payload_buf = [0; Self::ENCODED_LEN];
11648 let mut buf = if avail_len < Self::ENCODED_LEN {
11649 payload_buf[0..avail_len].copy_from_slice(__input);
11650 Bytes::new(&payload_buf)
11651 } else {
11652 Bytes::new(__input)
11653 };
11654 let mut __struct = Self::default();
11655 __struct.id = buf.get_u32_le();
11656 __struct.event_time_boot_ms = buf.get_u32_le();
11657 __struct.sequence = buf.get_u16_le();
11658 __struct.destination_component = buf.get_u8();
11659 __struct.destination_system = buf.get_u8();
11660 __struct.log_levels = buf.get_u8();
11661 for v in &mut __struct.arguments {
11662 let val = buf.get_u8();
11663 *v = val;
11664 }
11665 Ok(__struct)
11666 }
11667 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11668 let mut __tmp = BytesMut::new(bytes);
11669 #[allow(clippy::absurd_extreme_comparisons)]
11670 #[allow(unused_comparisons)]
11671 if __tmp.remaining() < Self::ENCODED_LEN {
11672 panic!(
11673 "buffer is too small (need {} bytes, but got {})",
11674 Self::ENCODED_LEN,
11675 __tmp.remaining(),
11676 )
11677 }
11678 __tmp.put_u32_le(self.id);
11679 __tmp.put_u32_le(self.event_time_boot_ms);
11680 __tmp.put_u16_le(self.sequence);
11681 __tmp.put_u8(self.destination_component);
11682 __tmp.put_u8(self.destination_system);
11683 __tmp.put_u8(self.log_levels);
11684 for val in &self.arguments {
11685 __tmp.put_u8(*val);
11686 }
11687 if matches!(version, MavlinkVersion::V2) {
11688 let len = __tmp.len();
11689 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11690 } else {
11691 __tmp.len()
11692 }
11693 }
11694}
11695#[doc = "Provides state for additional features."]
11696#[doc = ""]
11697#[doc = "ID: 245"]
11698#[derive(Debug, Clone, PartialEq)]
11699#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11700#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11701#[cfg_attr(feature = "ts", derive(TS))]
11702#[cfg_attr(feature = "ts", ts(export))]
11703pub struct EXTENDED_SYS_STATE_DATA {
11704 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11705 pub vtol_state: MavVtolState,
11706 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11707 pub landed_state: MavLandedState,
11708}
11709impl EXTENDED_SYS_STATE_DATA {
11710 pub const ENCODED_LEN: usize = 2usize;
11711 pub const DEFAULT: Self = Self {
11712 vtol_state: MavVtolState::DEFAULT,
11713 landed_state: MavLandedState::DEFAULT,
11714 };
11715 #[cfg(feature = "arbitrary")]
11716 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11717 use arbitrary::{Arbitrary, Unstructured};
11718 let mut buf = [0u8; 1024];
11719 rng.fill_bytes(&mut buf);
11720 let mut unstructured = Unstructured::new(&buf);
11721 Self::arbitrary(&mut unstructured).unwrap_or_default()
11722 }
11723}
11724impl Default for EXTENDED_SYS_STATE_DATA {
11725 fn default() -> Self {
11726 Self::DEFAULT.clone()
11727 }
11728}
11729impl MessageData for EXTENDED_SYS_STATE_DATA {
11730 type Message = MavMessage;
11731 const ID: u32 = 245u32;
11732 const NAME: &'static str = "EXTENDED_SYS_STATE";
11733 const EXTRA_CRC: u8 = 130u8;
11734 const ENCODED_LEN: usize = 2usize;
11735 fn deser(
11736 _version: MavlinkVersion,
11737 __input: &[u8],
11738 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11739 let avail_len = __input.len();
11740 let mut payload_buf = [0; Self::ENCODED_LEN];
11741 let mut buf = if avail_len < Self::ENCODED_LEN {
11742 payload_buf[0..avail_len].copy_from_slice(__input);
11743 Bytes::new(&payload_buf)
11744 } else {
11745 Bytes::new(__input)
11746 };
11747 let mut __struct = Self::default();
11748 let tmp = buf.get_u8();
11749 __struct.vtol_state =
11750 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11751 enum_type: "MavVtolState",
11752 value: tmp as u64,
11753 })?;
11754 let tmp = buf.get_u8();
11755 __struct.landed_state =
11756 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11757 enum_type: "MavLandedState",
11758 value: tmp as u64,
11759 })?;
11760 Ok(__struct)
11761 }
11762 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11763 let mut __tmp = BytesMut::new(bytes);
11764 #[allow(clippy::absurd_extreme_comparisons)]
11765 #[allow(unused_comparisons)]
11766 if __tmp.remaining() < Self::ENCODED_LEN {
11767 panic!(
11768 "buffer is too small (need {} bytes, but got {})",
11769 Self::ENCODED_LEN,
11770 __tmp.remaining(),
11771 )
11772 }
11773 __tmp.put_u8(self.vtol_state as u8);
11774 __tmp.put_u8(self.landed_state as u8);
11775 if matches!(version, MavlinkVersion::V2) {
11776 let len = __tmp.len();
11777 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11778 } else {
11779 __tmp.len()
11780 }
11781 }
11782}
11783#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11784#[doc = ""]
11785#[doc = "ID: 162"]
11786#[derive(Debug, Clone, PartialEq)]
11787#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11788#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11789#[cfg_attr(feature = "ts", derive(TS))]
11790#[cfg_attr(feature = "ts", ts(export))]
11791pub struct FENCE_STATUS_DATA {
11792 #[doc = "Time (since boot) of last breach."]
11793 pub breach_time: u32,
11794 #[doc = "Number of fence breaches."]
11795 pub breach_count: u16,
11796 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11797 pub breach_status: u8,
11798 #[doc = "Last breach type."]
11799 pub breach_type: FenceBreach,
11800 #[doc = "Active action to prevent fence breach"]
11801 #[cfg_attr(feature = "serde", serde(default))]
11802 pub breach_mitigation: FenceMitigate,
11803}
11804impl FENCE_STATUS_DATA {
11805 pub const ENCODED_LEN: usize = 9usize;
11806 pub const DEFAULT: Self = Self {
11807 breach_time: 0_u32,
11808 breach_count: 0_u16,
11809 breach_status: 0_u8,
11810 breach_type: FenceBreach::DEFAULT,
11811 breach_mitigation: FenceMitigate::DEFAULT,
11812 };
11813 #[cfg(feature = "arbitrary")]
11814 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11815 use arbitrary::{Arbitrary, Unstructured};
11816 let mut buf = [0u8; 1024];
11817 rng.fill_bytes(&mut buf);
11818 let mut unstructured = Unstructured::new(&buf);
11819 Self::arbitrary(&mut unstructured).unwrap_or_default()
11820 }
11821}
11822impl Default for FENCE_STATUS_DATA {
11823 fn default() -> Self {
11824 Self::DEFAULT.clone()
11825 }
11826}
11827impl MessageData for FENCE_STATUS_DATA {
11828 type Message = MavMessage;
11829 const ID: u32 = 162u32;
11830 const NAME: &'static str = "FENCE_STATUS";
11831 const EXTRA_CRC: u8 = 189u8;
11832 const ENCODED_LEN: usize = 9usize;
11833 fn deser(
11834 _version: MavlinkVersion,
11835 __input: &[u8],
11836 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11837 let avail_len = __input.len();
11838 let mut payload_buf = [0; Self::ENCODED_LEN];
11839 let mut buf = if avail_len < Self::ENCODED_LEN {
11840 payload_buf[0..avail_len].copy_from_slice(__input);
11841 Bytes::new(&payload_buf)
11842 } else {
11843 Bytes::new(__input)
11844 };
11845 let mut __struct = Self::default();
11846 __struct.breach_time = buf.get_u32_le();
11847 __struct.breach_count = buf.get_u16_le();
11848 __struct.breach_status = buf.get_u8();
11849 let tmp = buf.get_u8();
11850 __struct.breach_type =
11851 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11852 enum_type: "FenceBreach",
11853 value: tmp as u64,
11854 })?;
11855 let tmp = buf.get_u8();
11856 __struct.breach_mitigation =
11857 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11858 enum_type: "FenceMitigate",
11859 value: tmp as u64,
11860 })?;
11861 Ok(__struct)
11862 }
11863 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11864 let mut __tmp = BytesMut::new(bytes);
11865 #[allow(clippy::absurd_extreme_comparisons)]
11866 #[allow(unused_comparisons)]
11867 if __tmp.remaining() < Self::ENCODED_LEN {
11868 panic!(
11869 "buffer is too small (need {} bytes, but got {})",
11870 Self::ENCODED_LEN,
11871 __tmp.remaining(),
11872 )
11873 }
11874 __tmp.put_u32_le(self.breach_time);
11875 __tmp.put_u16_le(self.breach_count);
11876 __tmp.put_u8(self.breach_status);
11877 __tmp.put_u8(self.breach_type as u8);
11878 if matches!(version, MavlinkVersion::V2) {
11879 __tmp.put_u8(self.breach_mitigation as u8);
11880 let len = __tmp.len();
11881 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11882 } else {
11883 __tmp.len()
11884 }
11885 }
11886}
11887#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
11888#[doc = ""]
11889#[doc = "ID: 110"]
11890#[derive(Debug, Clone, PartialEq)]
11891#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11892#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11893#[cfg_attr(feature = "ts", derive(TS))]
11894#[cfg_attr(feature = "ts", ts(export))]
11895pub struct FILE_TRANSFER_PROTOCOL_DATA {
11896 #[doc = "Network ID (0 for broadcast)"]
11897 pub target_network: u8,
11898 #[doc = "System ID (0 for broadcast)"]
11899 pub target_system: u8,
11900 #[doc = "Component ID (0 for broadcast)"]
11901 pub target_component: u8,
11902 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
11903 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11904 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11905 pub payload: [u8; 251],
11906}
11907impl FILE_TRANSFER_PROTOCOL_DATA {
11908 pub const ENCODED_LEN: usize = 254usize;
11909 pub const DEFAULT: Self = Self {
11910 target_network: 0_u8,
11911 target_system: 0_u8,
11912 target_component: 0_u8,
11913 payload: [0_u8; 251usize],
11914 };
11915 #[cfg(feature = "arbitrary")]
11916 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11917 use arbitrary::{Arbitrary, Unstructured};
11918 let mut buf = [0u8; 1024];
11919 rng.fill_bytes(&mut buf);
11920 let mut unstructured = Unstructured::new(&buf);
11921 Self::arbitrary(&mut unstructured).unwrap_or_default()
11922 }
11923}
11924impl Default for FILE_TRANSFER_PROTOCOL_DATA {
11925 fn default() -> Self {
11926 Self::DEFAULT.clone()
11927 }
11928}
11929impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
11930 type Message = MavMessage;
11931 const ID: u32 = 110u32;
11932 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
11933 const EXTRA_CRC: u8 = 84u8;
11934 const ENCODED_LEN: usize = 254usize;
11935 fn deser(
11936 _version: MavlinkVersion,
11937 __input: &[u8],
11938 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11939 let avail_len = __input.len();
11940 let mut payload_buf = [0; Self::ENCODED_LEN];
11941 let mut buf = if avail_len < Self::ENCODED_LEN {
11942 payload_buf[0..avail_len].copy_from_slice(__input);
11943 Bytes::new(&payload_buf)
11944 } else {
11945 Bytes::new(__input)
11946 };
11947 let mut __struct = Self::default();
11948 __struct.target_network = buf.get_u8();
11949 __struct.target_system = buf.get_u8();
11950 __struct.target_component = buf.get_u8();
11951 for v in &mut __struct.payload {
11952 let val = buf.get_u8();
11953 *v = val;
11954 }
11955 Ok(__struct)
11956 }
11957 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11958 let mut __tmp = BytesMut::new(bytes);
11959 #[allow(clippy::absurd_extreme_comparisons)]
11960 #[allow(unused_comparisons)]
11961 if __tmp.remaining() < Self::ENCODED_LEN {
11962 panic!(
11963 "buffer is too small (need {} bytes, but got {})",
11964 Self::ENCODED_LEN,
11965 __tmp.remaining(),
11966 )
11967 }
11968 __tmp.put_u8(self.target_network);
11969 __tmp.put_u8(self.target_system);
11970 __tmp.put_u8(self.target_component);
11971 for val in &self.payload {
11972 __tmp.put_u8(*val);
11973 }
11974 if matches!(version, MavlinkVersion::V2) {
11975 let len = __tmp.len();
11976 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11977 } else {
11978 __tmp.len()
11979 }
11980 }
11981}
11982#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
11983#[doc = ""]
11984#[doc = "ID: 264"]
11985#[derive(Debug, Clone, PartialEq)]
11986#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11987#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11988#[cfg_attr(feature = "ts", derive(TS))]
11989#[cfg_attr(feature = "ts", ts(export))]
11990pub struct FLIGHT_INFORMATION_DATA {
11991 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
11992 pub arming_time_utc: u64,
11993 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
11994 pub takeoff_time_utc: u64,
11995 #[doc = "Flight number. Note, field is misnamed UUID."]
11996 pub flight_uuid: u64,
11997 #[doc = "Timestamp (time since system boot)."]
11998 pub time_boot_ms: u32,
11999 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
12000 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12001 pub landing_time: u32,
12002}
12003impl FLIGHT_INFORMATION_DATA {
12004 pub const ENCODED_LEN: usize = 32usize;
12005 pub const DEFAULT: Self = Self {
12006 arming_time_utc: 0_u64,
12007 takeoff_time_utc: 0_u64,
12008 flight_uuid: 0_u64,
12009 time_boot_ms: 0_u32,
12010 landing_time: 0_u32,
12011 };
12012 #[cfg(feature = "arbitrary")]
12013 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12014 use arbitrary::{Arbitrary, Unstructured};
12015 let mut buf = [0u8; 1024];
12016 rng.fill_bytes(&mut buf);
12017 let mut unstructured = Unstructured::new(&buf);
12018 Self::arbitrary(&mut unstructured).unwrap_or_default()
12019 }
12020}
12021impl Default for FLIGHT_INFORMATION_DATA {
12022 fn default() -> Self {
12023 Self::DEFAULT.clone()
12024 }
12025}
12026impl MessageData for FLIGHT_INFORMATION_DATA {
12027 type Message = MavMessage;
12028 const ID: u32 = 264u32;
12029 const NAME: &'static str = "FLIGHT_INFORMATION";
12030 const EXTRA_CRC: u8 = 49u8;
12031 const ENCODED_LEN: usize = 32usize;
12032 fn deser(
12033 _version: MavlinkVersion,
12034 __input: &[u8],
12035 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12036 let avail_len = __input.len();
12037 let mut payload_buf = [0; Self::ENCODED_LEN];
12038 let mut buf = if avail_len < Self::ENCODED_LEN {
12039 payload_buf[0..avail_len].copy_from_slice(__input);
12040 Bytes::new(&payload_buf)
12041 } else {
12042 Bytes::new(__input)
12043 };
12044 let mut __struct = Self::default();
12045 __struct.arming_time_utc = buf.get_u64_le();
12046 __struct.takeoff_time_utc = buf.get_u64_le();
12047 __struct.flight_uuid = buf.get_u64_le();
12048 __struct.time_boot_ms = buf.get_u32_le();
12049 __struct.landing_time = buf.get_u32_le();
12050 Ok(__struct)
12051 }
12052 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12053 let mut __tmp = BytesMut::new(bytes);
12054 #[allow(clippy::absurd_extreme_comparisons)]
12055 #[allow(unused_comparisons)]
12056 if __tmp.remaining() < Self::ENCODED_LEN {
12057 panic!(
12058 "buffer is too small (need {} bytes, but got {})",
12059 Self::ENCODED_LEN,
12060 __tmp.remaining(),
12061 )
12062 }
12063 __tmp.put_u64_le(self.arming_time_utc);
12064 __tmp.put_u64_le(self.takeoff_time_utc);
12065 __tmp.put_u64_le(self.flight_uuid);
12066 __tmp.put_u32_le(self.time_boot_ms);
12067 if matches!(version, MavlinkVersion::V2) {
12068 __tmp.put_u32_le(self.landing_time);
12069 let len = __tmp.len();
12070 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12071 } else {
12072 __tmp.len()
12073 }
12074 }
12075}
12076#[doc = "Current motion information from a designated system."]
12077#[doc = ""]
12078#[doc = "ID: 144"]
12079#[derive(Debug, Clone, PartialEq)]
12080#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12081#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12082#[cfg_attr(feature = "ts", derive(TS))]
12083#[cfg_attr(feature = "ts", ts(export))]
12084pub struct FOLLOW_TARGET_DATA {
12085 #[doc = "Timestamp (time since system boot)."]
12086 pub timestamp: u64,
12087 #[doc = "button states or switches of a tracker device"]
12088 pub custom_state: u64,
12089 #[doc = "Latitude (WGS84)"]
12090 pub lat: i32,
12091 #[doc = "Longitude (WGS84)"]
12092 pub lon: i32,
12093 #[doc = "Altitude (MSL)"]
12094 pub alt: f32,
12095 #[doc = "target velocity (0,0,0) for unknown"]
12096 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12097 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12098 pub vel: [f32; 3],
12099 #[doc = "linear target acceleration (0,0,0) for unknown"]
12100 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12101 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12102 pub acc: [f32; 3],
12103 #[doc = "(0 0 0 0 for unknown)"]
12104 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12105 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12106 pub attitude_q: [f32; 4],
12107 #[doc = "(0 0 0 for unknown)"]
12108 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12109 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12110 pub rates: [f32; 3],
12111 #[doc = "eph epv"]
12112 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12113 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12114 pub position_cov: [f32; 3],
12115 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
12116 pub est_capabilities: u8,
12117}
12118impl FOLLOW_TARGET_DATA {
12119 pub const ENCODED_LEN: usize = 93usize;
12120 pub const DEFAULT: Self = Self {
12121 timestamp: 0_u64,
12122 custom_state: 0_u64,
12123 lat: 0_i32,
12124 lon: 0_i32,
12125 alt: 0.0_f32,
12126 vel: [0.0_f32; 3usize],
12127 acc: [0.0_f32; 3usize],
12128 attitude_q: [0.0_f32; 4usize],
12129 rates: [0.0_f32; 3usize],
12130 position_cov: [0.0_f32; 3usize],
12131 est_capabilities: 0_u8,
12132 };
12133 #[cfg(feature = "arbitrary")]
12134 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12135 use arbitrary::{Arbitrary, Unstructured};
12136 let mut buf = [0u8; 1024];
12137 rng.fill_bytes(&mut buf);
12138 let mut unstructured = Unstructured::new(&buf);
12139 Self::arbitrary(&mut unstructured).unwrap_or_default()
12140 }
12141}
12142impl Default for FOLLOW_TARGET_DATA {
12143 fn default() -> Self {
12144 Self::DEFAULT.clone()
12145 }
12146}
12147impl MessageData for FOLLOW_TARGET_DATA {
12148 type Message = MavMessage;
12149 const ID: u32 = 144u32;
12150 const NAME: &'static str = "FOLLOW_TARGET";
12151 const EXTRA_CRC: u8 = 127u8;
12152 const ENCODED_LEN: usize = 93usize;
12153 fn deser(
12154 _version: MavlinkVersion,
12155 __input: &[u8],
12156 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12157 let avail_len = __input.len();
12158 let mut payload_buf = [0; Self::ENCODED_LEN];
12159 let mut buf = if avail_len < Self::ENCODED_LEN {
12160 payload_buf[0..avail_len].copy_from_slice(__input);
12161 Bytes::new(&payload_buf)
12162 } else {
12163 Bytes::new(__input)
12164 };
12165 let mut __struct = Self::default();
12166 __struct.timestamp = buf.get_u64_le();
12167 __struct.custom_state = buf.get_u64_le();
12168 __struct.lat = buf.get_i32_le();
12169 __struct.lon = buf.get_i32_le();
12170 __struct.alt = buf.get_f32_le();
12171 for v in &mut __struct.vel {
12172 let val = buf.get_f32_le();
12173 *v = val;
12174 }
12175 for v in &mut __struct.acc {
12176 let val = buf.get_f32_le();
12177 *v = val;
12178 }
12179 for v in &mut __struct.attitude_q {
12180 let val = buf.get_f32_le();
12181 *v = val;
12182 }
12183 for v in &mut __struct.rates {
12184 let val = buf.get_f32_le();
12185 *v = val;
12186 }
12187 for v in &mut __struct.position_cov {
12188 let val = buf.get_f32_le();
12189 *v = val;
12190 }
12191 __struct.est_capabilities = buf.get_u8();
12192 Ok(__struct)
12193 }
12194 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12195 let mut __tmp = BytesMut::new(bytes);
12196 #[allow(clippy::absurd_extreme_comparisons)]
12197 #[allow(unused_comparisons)]
12198 if __tmp.remaining() < Self::ENCODED_LEN {
12199 panic!(
12200 "buffer is too small (need {} bytes, but got {})",
12201 Self::ENCODED_LEN,
12202 __tmp.remaining(),
12203 )
12204 }
12205 __tmp.put_u64_le(self.timestamp);
12206 __tmp.put_u64_le(self.custom_state);
12207 __tmp.put_i32_le(self.lat);
12208 __tmp.put_i32_le(self.lon);
12209 __tmp.put_f32_le(self.alt);
12210 for val in &self.vel {
12211 __tmp.put_f32_le(*val);
12212 }
12213 for val in &self.acc {
12214 __tmp.put_f32_le(*val);
12215 }
12216 for val in &self.attitude_q {
12217 __tmp.put_f32_le(*val);
12218 }
12219 for val in &self.rates {
12220 __tmp.put_f32_le(*val);
12221 }
12222 for val in &self.position_cov {
12223 __tmp.put_f32_le(*val);
12224 }
12225 __tmp.put_u8(self.est_capabilities);
12226 if matches!(version, MavlinkVersion::V2) {
12227 let len = __tmp.len();
12228 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12229 } else {
12230 __tmp.len()
12231 }
12232 }
12233}
12234#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
12235#[doc = ""]
12236#[doc = "ID: 371"]
12237#[derive(Debug, Clone, PartialEq)]
12238#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12239#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12240#[cfg_attr(feature = "ts", derive(TS))]
12241#[cfg_attr(feature = "ts", ts(export))]
12242pub struct FUEL_STATUS_DATA {
12243 #[doc = "Capacity when full. Must be provided."]
12244 pub maximum_fuel: f32,
12245 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12246 pub consumed_fuel: f32,
12247 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12248 pub remaining_fuel: f32,
12249 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
12250 pub flow_rate: f32,
12251 #[doc = "Fuel temperature. NaN: field not provided."]
12252 pub temperature: f32,
12253 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
12254 pub fuel_type: MavFuelType,
12255 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
12256 pub id: u8,
12257 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
12258 pub percent_remaining: u8,
12259}
12260impl FUEL_STATUS_DATA {
12261 pub const ENCODED_LEN: usize = 26usize;
12262 pub const DEFAULT: Self = Self {
12263 maximum_fuel: 0.0_f32,
12264 consumed_fuel: 0.0_f32,
12265 remaining_fuel: 0.0_f32,
12266 flow_rate: 0.0_f32,
12267 temperature: 0.0_f32,
12268 fuel_type: MavFuelType::DEFAULT,
12269 id: 0_u8,
12270 percent_remaining: 0_u8,
12271 };
12272 #[cfg(feature = "arbitrary")]
12273 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12274 use arbitrary::{Arbitrary, Unstructured};
12275 let mut buf = [0u8; 1024];
12276 rng.fill_bytes(&mut buf);
12277 let mut unstructured = Unstructured::new(&buf);
12278 Self::arbitrary(&mut unstructured).unwrap_or_default()
12279 }
12280}
12281impl Default for FUEL_STATUS_DATA {
12282 fn default() -> Self {
12283 Self::DEFAULT.clone()
12284 }
12285}
12286impl MessageData for FUEL_STATUS_DATA {
12287 type Message = MavMessage;
12288 const ID: u32 = 371u32;
12289 const NAME: &'static str = "FUEL_STATUS";
12290 const EXTRA_CRC: u8 = 10u8;
12291 const ENCODED_LEN: usize = 26usize;
12292 fn deser(
12293 _version: MavlinkVersion,
12294 __input: &[u8],
12295 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12296 let avail_len = __input.len();
12297 let mut payload_buf = [0; Self::ENCODED_LEN];
12298 let mut buf = if avail_len < Self::ENCODED_LEN {
12299 payload_buf[0..avail_len].copy_from_slice(__input);
12300 Bytes::new(&payload_buf)
12301 } else {
12302 Bytes::new(__input)
12303 };
12304 let mut __struct = Self::default();
12305 __struct.maximum_fuel = buf.get_f32_le();
12306 __struct.consumed_fuel = buf.get_f32_le();
12307 __struct.remaining_fuel = buf.get_f32_le();
12308 __struct.flow_rate = buf.get_f32_le();
12309 __struct.temperature = buf.get_f32_le();
12310 let tmp = buf.get_u32_le();
12311 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
12312 ::mavlink_core::error::ParserError::InvalidEnum {
12313 enum_type: "MavFuelType",
12314 value: tmp as u64,
12315 },
12316 )?;
12317 __struct.id = buf.get_u8();
12318 __struct.percent_remaining = buf.get_u8();
12319 Ok(__struct)
12320 }
12321 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12322 let mut __tmp = BytesMut::new(bytes);
12323 #[allow(clippy::absurd_extreme_comparisons)]
12324 #[allow(unused_comparisons)]
12325 if __tmp.remaining() < Self::ENCODED_LEN {
12326 panic!(
12327 "buffer is too small (need {} bytes, but got {})",
12328 Self::ENCODED_LEN,
12329 __tmp.remaining(),
12330 )
12331 }
12332 __tmp.put_f32_le(self.maximum_fuel);
12333 __tmp.put_f32_le(self.consumed_fuel);
12334 __tmp.put_f32_le(self.remaining_fuel);
12335 __tmp.put_f32_le(self.flow_rate);
12336 __tmp.put_f32_le(self.temperature);
12337 __tmp.put_u32_le(self.fuel_type as u32);
12338 __tmp.put_u8(self.id);
12339 __tmp.put_u8(self.percent_remaining);
12340 if matches!(version, MavlinkVersion::V2) {
12341 let len = __tmp.len();
12342 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12343 } else {
12344 __tmp.len()
12345 }
12346 }
12347}
12348#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
12349#[doc = ""]
12350#[doc = "ID: 373"]
12351#[derive(Debug, Clone, PartialEq)]
12352#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12353#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12354#[cfg_attr(feature = "ts", derive(TS))]
12355#[cfg_attr(feature = "ts", ts(export))]
12356pub struct GENERATOR_STATUS_DATA {
12357 #[doc = "Status flags."]
12358 pub status: MavGeneratorStatusFlag,
12359 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
12360 pub battery_current: f32,
12361 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
12362 pub load_current: f32,
12363 #[doc = "The power being generated. NaN: field not provided"]
12364 pub power_generated: f32,
12365 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
12366 pub bus_voltage: f32,
12367 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
12368 pub bat_current_setpoint: f32,
12369 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
12370 pub runtime: u32,
12371 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
12372 pub time_until_maintenance: i32,
12373 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
12374 pub generator_speed: u16,
12375 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
12376 pub rectifier_temperature: i16,
12377 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
12378 pub generator_temperature: i16,
12379}
12380impl GENERATOR_STATUS_DATA {
12381 pub const ENCODED_LEN: usize = 42usize;
12382 pub const DEFAULT: Self = Self {
12383 status: MavGeneratorStatusFlag::DEFAULT,
12384 battery_current: 0.0_f32,
12385 load_current: 0.0_f32,
12386 power_generated: 0.0_f32,
12387 bus_voltage: 0.0_f32,
12388 bat_current_setpoint: 0.0_f32,
12389 runtime: 0_u32,
12390 time_until_maintenance: 0_i32,
12391 generator_speed: 0_u16,
12392 rectifier_temperature: 0_i16,
12393 generator_temperature: 0_i16,
12394 };
12395 #[cfg(feature = "arbitrary")]
12396 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12397 use arbitrary::{Arbitrary, Unstructured};
12398 let mut buf = [0u8; 1024];
12399 rng.fill_bytes(&mut buf);
12400 let mut unstructured = Unstructured::new(&buf);
12401 Self::arbitrary(&mut unstructured).unwrap_or_default()
12402 }
12403}
12404impl Default for GENERATOR_STATUS_DATA {
12405 fn default() -> Self {
12406 Self::DEFAULT.clone()
12407 }
12408}
12409impl MessageData for GENERATOR_STATUS_DATA {
12410 type Message = MavMessage;
12411 const ID: u32 = 373u32;
12412 const NAME: &'static str = "GENERATOR_STATUS";
12413 const EXTRA_CRC: u8 = 117u8;
12414 const ENCODED_LEN: usize = 42usize;
12415 fn deser(
12416 _version: MavlinkVersion,
12417 __input: &[u8],
12418 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12419 let avail_len = __input.len();
12420 let mut payload_buf = [0; Self::ENCODED_LEN];
12421 let mut buf = if avail_len < Self::ENCODED_LEN {
12422 payload_buf[0..avail_len].copy_from_slice(__input);
12423 Bytes::new(&payload_buf)
12424 } else {
12425 Bytes::new(__input)
12426 };
12427 let mut __struct = Self::default();
12428 let tmp = buf.get_u64_le();
12429 __struct.status =
12430 MavGeneratorStatusFlag::from_bits(tmp as <MavGeneratorStatusFlag as Flags>::Bits)
12431 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12432 flag_type: "MavGeneratorStatusFlag",
12433 value: tmp as u64,
12434 })?;
12435 __struct.battery_current = buf.get_f32_le();
12436 __struct.load_current = buf.get_f32_le();
12437 __struct.power_generated = buf.get_f32_le();
12438 __struct.bus_voltage = buf.get_f32_le();
12439 __struct.bat_current_setpoint = buf.get_f32_le();
12440 __struct.runtime = buf.get_u32_le();
12441 __struct.time_until_maintenance = buf.get_i32_le();
12442 __struct.generator_speed = buf.get_u16_le();
12443 __struct.rectifier_temperature = buf.get_i16_le();
12444 __struct.generator_temperature = buf.get_i16_le();
12445 Ok(__struct)
12446 }
12447 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12448 let mut __tmp = BytesMut::new(bytes);
12449 #[allow(clippy::absurd_extreme_comparisons)]
12450 #[allow(unused_comparisons)]
12451 if __tmp.remaining() < Self::ENCODED_LEN {
12452 panic!(
12453 "buffer is too small (need {} bytes, but got {})",
12454 Self::ENCODED_LEN,
12455 __tmp.remaining(),
12456 )
12457 }
12458 __tmp.put_u64_le(self.status.bits() as u64);
12459 __tmp.put_f32_le(self.battery_current);
12460 __tmp.put_f32_le(self.load_current);
12461 __tmp.put_f32_le(self.power_generated);
12462 __tmp.put_f32_le(self.bus_voltage);
12463 __tmp.put_f32_le(self.bat_current_setpoint);
12464 __tmp.put_u32_le(self.runtime);
12465 __tmp.put_i32_le(self.time_until_maintenance);
12466 __tmp.put_u16_le(self.generator_speed);
12467 __tmp.put_i16_le(self.rectifier_temperature);
12468 __tmp.put_i16_le(self.generator_temperature);
12469 if matches!(version, MavlinkVersion::V2) {
12470 let len = __tmp.len();
12471 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12472 } else {
12473 __tmp.len()
12474 }
12475 }
12476}
12477#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
12478#[doc = ""]
12479#[doc = "ID: 285"]
12480#[derive(Debug, Clone, PartialEq)]
12481#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12482#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12483#[cfg_attr(feature = "ts", derive(TS))]
12484#[cfg_attr(feature = "ts", ts(export))]
12485pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12486 #[doc = "Timestamp (time since system boot)."]
12487 pub time_boot_ms: u32,
12488 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
12489 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12490 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12491 pub q: [f32; 4],
12492 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
12493 pub angular_velocity_x: f32,
12494 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
12495 pub angular_velocity_y: f32,
12496 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
12497 pub angular_velocity_z: f32,
12498 #[doc = "Failure flags (0 for no failure)"]
12499 pub failure_flags: GimbalDeviceErrorFlags,
12500 #[doc = "Current gimbal flags set."]
12501 pub flags: GimbalDeviceFlags,
12502 #[doc = "System ID"]
12503 pub target_system: u8,
12504 #[doc = "Component ID"]
12505 pub target_component: u8,
12506 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
12507 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12508 pub delta_yaw: f32,
12509 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
12510 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12511 pub delta_yaw_velocity: f32,
12512 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12513 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12514 pub gimbal_device_id: u8,
12515}
12516impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12517 pub const ENCODED_LEN: usize = 49usize;
12518 pub const DEFAULT: Self = Self {
12519 time_boot_ms: 0_u32,
12520 q: [0.0_f32; 4usize],
12521 angular_velocity_x: 0.0_f32,
12522 angular_velocity_y: 0.0_f32,
12523 angular_velocity_z: 0.0_f32,
12524 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
12525 flags: GimbalDeviceFlags::DEFAULT,
12526 target_system: 0_u8,
12527 target_component: 0_u8,
12528 delta_yaw: 0.0_f32,
12529 delta_yaw_velocity: 0.0_f32,
12530 gimbal_device_id: 0_u8,
12531 };
12532 #[cfg(feature = "arbitrary")]
12533 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12534 use arbitrary::{Arbitrary, Unstructured};
12535 let mut buf = [0u8; 1024];
12536 rng.fill_bytes(&mut buf);
12537 let mut unstructured = Unstructured::new(&buf);
12538 Self::arbitrary(&mut unstructured).unwrap_or_default()
12539 }
12540}
12541impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12542 fn default() -> Self {
12543 Self::DEFAULT.clone()
12544 }
12545}
12546impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12547 type Message = MavMessage;
12548 const ID: u32 = 285u32;
12549 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
12550 const EXTRA_CRC: u8 = 137u8;
12551 const ENCODED_LEN: usize = 49usize;
12552 fn deser(
12553 _version: MavlinkVersion,
12554 __input: &[u8],
12555 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12556 let avail_len = __input.len();
12557 let mut payload_buf = [0; Self::ENCODED_LEN];
12558 let mut buf = if avail_len < Self::ENCODED_LEN {
12559 payload_buf[0..avail_len].copy_from_slice(__input);
12560 Bytes::new(&payload_buf)
12561 } else {
12562 Bytes::new(__input)
12563 };
12564 let mut __struct = Self::default();
12565 __struct.time_boot_ms = buf.get_u32_le();
12566 for v in &mut __struct.q {
12567 let val = buf.get_f32_le();
12568 *v = val;
12569 }
12570 __struct.angular_velocity_x = buf.get_f32_le();
12571 __struct.angular_velocity_y = buf.get_f32_le();
12572 __struct.angular_velocity_z = buf.get_f32_le();
12573 let tmp = buf.get_u32_le();
12574 __struct.failure_flags =
12575 GimbalDeviceErrorFlags::from_bits(tmp as <GimbalDeviceErrorFlags as Flags>::Bits)
12576 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12577 flag_type: "GimbalDeviceErrorFlags",
12578 value: tmp as u64,
12579 })?;
12580 let tmp = buf.get_u16_le();
12581 __struct.flags = GimbalDeviceFlags::from_bits(tmp as <GimbalDeviceFlags as Flags>::Bits)
12582 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12583 flag_type: "GimbalDeviceFlags",
12584 value: tmp as u64,
12585 })?;
12586 __struct.target_system = buf.get_u8();
12587 __struct.target_component = buf.get_u8();
12588 __struct.delta_yaw = buf.get_f32_le();
12589 __struct.delta_yaw_velocity = buf.get_f32_le();
12590 __struct.gimbal_device_id = buf.get_u8();
12591 Ok(__struct)
12592 }
12593 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12594 let mut __tmp = BytesMut::new(bytes);
12595 #[allow(clippy::absurd_extreme_comparisons)]
12596 #[allow(unused_comparisons)]
12597 if __tmp.remaining() < Self::ENCODED_LEN {
12598 panic!(
12599 "buffer is too small (need {} bytes, but got {})",
12600 Self::ENCODED_LEN,
12601 __tmp.remaining(),
12602 )
12603 }
12604 __tmp.put_u32_le(self.time_boot_ms);
12605 for val in &self.q {
12606 __tmp.put_f32_le(*val);
12607 }
12608 __tmp.put_f32_le(self.angular_velocity_x);
12609 __tmp.put_f32_le(self.angular_velocity_y);
12610 __tmp.put_f32_le(self.angular_velocity_z);
12611 __tmp.put_u32_le(self.failure_flags.bits() as u32);
12612 __tmp.put_u16_le(self.flags.bits() as u16);
12613 __tmp.put_u8(self.target_system);
12614 __tmp.put_u8(self.target_component);
12615 if matches!(version, MavlinkVersion::V2) {
12616 __tmp.put_f32_le(self.delta_yaw);
12617 __tmp.put_f32_le(self.delta_yaw_velocity);
12618 __tmp.put_u8(self.gimbal_device_id);
12619 let len = __tmp.len();
12620 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12621 } else {
12622 __tmp.len()
12623 }
12624 }
12625}
12626#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
12627#[doc = ""]
12628#[doc = "ID: 283"]
12629#[derive(Debug, Clone, PartialEq)]
12630#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12631#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12632#[cfg_attr(feature = "ts", derive(TS))]
12633#[cfg_attr(feature = "ts", ts(export))]
12634pub struct GIMBAL_DEVICE_INFORMATION_DATA {
12635 #[doc = "UID of gimbal hardware (0 if unknown)."]
12636 pub uid: u64,
12637 #[doc = "Timestamp (time since system boot)."]
12638 pub time_boot_ms: u32,
12639 #[doc = "0xff)."]
12640 pub firmware_version: u32,
12641 #[doc = "0xff)."]
12642 pub hardware_version: u32,
12643 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12644 pub roll_min: f32,
12645 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12646 pub roll_max: f32,
12647 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12648 pub pitch_min: f32,
12649 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12650 pub pitch_max: f32,
12651 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12652 pub yaw_min: f32,
12653 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12654 pub yaw_max: f32,
12655 #[doc = "Bitmap of gimbal capability flags."]
12656 pub cap_flags: GimbalDeviceCapFlags,
12657 #[doc = "Bitmap for use for gimbal-specific capability flags."]
12658 pub custom_cap_flags: u16,
12659 #[doc = "Name of the gimbal vendor."]
12660 #[cfg_attr(feature = "ts", ts(type = "string"))]
12661 pub vendor_name: CharArray<32>,
12662 #[doc = "Name of the gimbal model."]
12663 #[cfg_attr(feature = "ts", ts(type = "string"))]
12664 pub model_name: CharArray<32>,
12665 #[doc = "Custom name of the gimbal given to it by the user."]
12666 #[cfg_attr(feature = "ts", ts(type = "string"))]
12667 pub custom_name: CharArray<32>,
12668 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12669 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12670 pub gimbal_device_id: u8,
12671}
12672impl GIMBAL_DEVICE_INFORMATION_DATA {
12673 pub const ENCODED_LEN: usize = 145usize;
12674 pub const DEFAULT: Self = Self {
12675 uid: 0_u64,
12676 time_boot_ms: 0_u32,
12677 firmware_version: 0_u32,
12678 hardware_version: 0_u32,
12679 roll_min: 0.0_f32,
12680 roll_max: 0.0_f32,
12681 pitch_min: 0.0_f32,
12682 pitch_max: 0.0_f32,
12683 yaw_min: 0.0_f32,
12684 yaw_max: 0.0_f32,
12685 cap_flags: GimbalDeviceCapFlags::DEFAULT,
12686 custom_cap_flags: 0_u16,
12687 vendor_name: CharArray::new([0_u8; 32usize]),
12688 model_name: CharArray::new([0_u8; 32usize]),
12689 custom_name: CharArray::new([0_u8; 32usize]),
12690 gimbal_device_id: 0_u8,
12691 };
12692 #[cfg(feature = "arbitrary")]
12693 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12694 use arbitrary::{Arbitrary, Unstructured};
12695 let mut buf = [0u8; 1024];
12696 rng.fill_bytes(&mut buf);
12697 let mut unstructured = Unstructured::new(&buf);
12698 Self::arbitrary(&mut unstructured).unwrap_or_default()
12699 }
12700}
12701impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
12702 fn default() -> Self {
12703 Self::DEFAULT.clone()
12704 }
12705}
12706impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
12707 type Message = MavMessage;
12708 const ID: u32 = 283u32;
12709 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
12710 const EXTRA_CRC: u8 = 74u8;
12711 const ENCODED_LEN: usize = 145usize;
12712 fn deser(
12713 _version: MavlinkVersion,
12714 __input: &[u8],
12715 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12716 let avail_len = __input.len();
12717 let mut payload_buf = [0; Self::ENCODED_LEN];
12718 let mut buf = if avail_len < Self::ENCODED_LEN {
12719 payload_buf[0..avail_len].copy_from_slice(__input);
12720 Bytes::new(&payload_buf)
12721 } else {
12722 Bytes::new(__input)
12723 };
12724 let mut __struct = Self::default();
12725 __struct.uid = buf.get_u64_le();
12726 __struct.time_boot_ms = buf.get_u32_le();
12727 __struct.firmware_version = buf.get_u32_le();
12728 __struct.hardware_version = buf.get_u32_le();
12729 __struct.roll_min = buf.get_f32_le();
12730 __struct.roll_max = buf.get_f32_le();
12731 __struct.pitch_min = buf.get_f32_le();
12732 __struct.pitch_max = buf.get_f32_le();
12733 __struct.yaw_min = buf.get_f32_le();
12734 __struct.yaw_max = buf.get_f32_le();
12735 let tmp = buf.get_u16_le();
12736 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
12737 tmp as <GimbalDeviceCapFlags as Flags>::Bits,
12738 )
12739 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12740 flag_type: "GimbalDeviceCapFlags",
12741 value: tmp as u64,
12742 })?;
12743 __struct.custom_cap_flags = buf.get_u16_le();
12744 let mut tmp = [0_u8; 32usize];
12745 for v in &mut tmp {
12746 *v = buf.get_u8();
12747 }
12748 __struct.vendor_name = CharArray::new(tmp);
12749 let mut tmp = [0_u8; 32usize];
12750 for v in &mut tmp {
12751 *v = buf.get_u8();
12752 }
12753 __struct.model_name = CharArray::new(tmp);
12754 let mut tmp = [0_u8; 32usize];
12755 for v in &mut tmp {
12756 *v = buf.get_u8();
12757 }
12758 __struct.custom_name = CharArray::new(tmp);
12759 __struct.gimbal_device_id = buf.get_u8();
12760 Ok(__struct)
12761 }
12762 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12763 let mut __tmp = BytesMut::new(bytes);
12764 #[allow(clippy::absurd_extreme_comparisons)]
12765 #[allow(unused_comparisons)]
12766 if __tmp.remaining() < Self::ENCODED_LEN {
12767 panic!(
12768 "buffer is too small (need {} bytes, but got {})",
12769 Self::ENCODED_LEN,
12770 __tmp.remaining(),
12771 )
12772 }
12773 __tmp.put_u64_le(self.uid);
12774 __tmp.put_u32_le(self.time_boot_ms);
12775 __tmp.put_u32_le(self.firmware_version);
12776 __tmp.put_u32_le(self.hardware_version);
12777 __tmp.put_f32_le(self.roll_min);
12778 __tmp.put_f32_le(self.roll_max);
12779 __tmp.put_f32_le(self.pitch_min);
12780 __tmp.put_f32_le(self.pitch_max);
12781 __tmp.put_f32_le(self.yaw_min);
12782 __tmp.put_f32_le(self.yaw_max);
12783 __tmp.put_u16_le(self.cap_flags.bits() as u16);
12784 __tmp.put_u16_le(self.custom_cap_flags);
12785 for val in &self.vendor_name {
12786 __tmp.put_u8(*val);
12787 }
12788 for val in &self.model_name {
12789 __tmp.put_u8(*val);
12790 }
12791 for val in &self.custom_name {
12792 __tmp.put_u8(*val);
12793 }
12794 if matches!(version, MavlinkVersion::V2) {
12795 __tmp.put_u8(self.gimbal_device_id);
12796 let len = __tmp.len();
12797 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12798 } else {
12799 __tmp.len()
12800 }
12801 }
12802}
12803#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
12804#[doc = ""]
12805#[doc = "ID: 284"]
12806#[derive(Debug, Clone, PartialEq)]
12807#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12808#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12809#[cfg_attr(feature = "ts", derive(TS))]
12810#[cfg_attr(feature = "ts", ts(export))]
12811pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12812 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
12813 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12814 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12815 pub q: [f32; 4],
12816 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
12817 pub angular_velocity_x: f32,
12818 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
12819 pub angular_velocity_y: f32,
12820 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
12821 pub angular_velocity_z: f32,
12822 #[doc = "Low level gimbal flags."]
12823 pub flags: GimbalDeviceFlags,
12824 #[doc = "System ID"]
12825 pub target_system: u8,
12826 #[doc = "Component ID"]
12827 pub target_component: u8,
12828}
12829impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12830 pub const ENCODED_LEN: usize = 32usize;
12831 pub const DEFAULT: Self = Self {
12832 q: [0.0_f32; 4usize],
12833 angular_velocity_x: 0.0_f32,
12834 angular_velocity_y: 0.0_f32,
12835 angular_velocity_z: 0.0_f32,
12836 flags: GimbalDeviceFlags::DEFAULT,
12837 target_system: 0_u8,
12838 target_component: 0_u8,
12839 };
12840 #[cfg(feature = "arbitrary")]
12841 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12842 use arbitrary::{Arbitrary, Unstructured};
12843 let mut buf = [0u8; 1024];
12844 rng.fill_bytes(&mut buf);
12845 let mut unstructured = Unstructured::new(&buf);
12846 Self::arbitrary(&mut unstructured).unwrap_or_default()
12847 }
12848}
12849impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12850 fn default() -> Self {
12851 Self::DEFAULT.clone()
12852 }
12853}
12854impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12855 type Message = MavMessage;
12856 const ID: u32 = 284u32;
12857 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
12858 const EXTRA_CRC: u8 = 99u8;
12859 const ENCODED_LEN: usize = 32usize;
12860 fn deser(
12861 _version: MavlinkVersion,
12862 __input: &[u8],
12863 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12864 let avail_len = __input.len();
12865 let mut payload_buf = [0; Self::ENCODED_LEN];
12866 let mut buf = if avail_len < Self::ENCODED_LEN {
12867 payload_buf[0..avail_len].copy_from_slice(__input);
12868 Bytes::new(&payload_buf)
12869 } else {
12870 Bytes::new(__input)
12871 };
12872 let mut __struct = Self::default();
12873 for v in &mut __struct.q {
12874 let val = buf.get_f32_le();
12875 *v = val;
12876 }
12877 __struct.angular_velocity_x = buf.get_f32_le();
12878 __struct.angular_velocity_y = buf.get_f32_le();
12879 __struct.angular_velocity_z = buf.get_f32_le();
12880 let tmp = buf.get_u16_le();
12881 __struct.flags = GimbalDeviceFlags::from_bits(tmp as <GimbalDeviceFlags as Flags>::Bits)
12882 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12883 flag_type: "GimbalDeviceFlags",
12884 value: tmp as u64,
12885 })?;
12886 __struct.target_system = buf.get_u8();
12887 __struct.target_component = buf.get_u8();
12888 Ok(__struct)
12889 }
12890 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12891 let mut __tmp = BytesMut::new(bytes);
12892 #[allow(clippy::absurd_extreme_comparisons)]
12893 #[allow(unused_comparisons)]
12894 if __tmp.remaining() < Self::ENCODED_LEN {
12895 panic!(
12896 "buffer is too small (need {} bytes, but got {})",
12897 Self::ENCODED_LEN,
12898 __tmp.remaining(),
12899 )
12900 }
12901 for val in &self.q {
12902 __tmp.put_f32_le(*val);
12903 }
12904 __tmp.put_f32_le(self.angular_velocity_x);
12905 __tmp.put_f32_le(self.angular_velocity_y);
12906 __tmp.put_f32_le(self.angular_velocity_z);
12907 __tmp.put_u16_le(self.flags.bits() as u16);
12908 __tmp.put_u8(self.target_system);
12909 __tmp.put_u8(self.target_component);
12910 if matches!(version, MavlinkVersion::V2) {
12911 let len = __tmp.len();
12912 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12913 } else {
12914 __tmp.len()
12915 }
12916 }
12917}
12918#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
12919#[doc = ""]
12920#[doc = "ID: 280"]
12921#[derive(Debug, Clone, PartialEq)]
12922#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12923#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12924#[cfg_attr(feature = "ts", derive(TS))]
12925#[cfg_attr(feature = "ts", ts(export))]
12926pub struct GIMBAL_MANAGER_INFORMATION_DATA {
12927 #[doc = "Timestamp (time since system boot)."]
12928 pub time_boot_ms: u32,
12929 #[doc = "Bitmap of gimbal capability flags."]
12930 pub cap_flags: GimbalManagerCapFlags,
12931 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12932 pub roll_min: f32,
12933 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12934 pub roll_max: f32,
12935 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
12936 pub pitch_min: f32,
12937 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
12938 pub pitch_max: f32,
12939 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
12940 pub yaw_min: f32,
12941 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
12942 pub yaw_max: f32,
12943 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12944 pub gimbal_device_id: u8,
12945}
12946impl GIMBAL_MANAGER_INFORMATION_DATA {
12947 pub const ENCODED_LEN: usize = 33usize;
12948 pub const DEFAULT: Self = Self {
12949 time_boot_ms: 0_u32,
12950 cap_flags: GimbalManagerCapFlags::DEFAULT,
12951 roll_min: 0.0_f32,
12952 roll_max: 0.0_f32,
12953 pitch_min: 0.0_f32,
12954 pitch_max: 0.0_f32,
12955 yaw_min: 0.0_f32,
12956 yaw_max: 0.0_f32,
12957 gimbal_device_id: 0_u8,
12958 };
12959 #[cfg(feature = "arbitrary")]
12960 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12961 use arbitrary::{Arbitrary, Unstructured};
12962 let mut buf = [0u8; 1024];
12963 rng.fill_bytes(&mut buf);
12964 let mut unstructured = Unstructured::new(&buf);
12965 Self::arbitrary(&mut unstructured).unwrap_or_default()
12966 }
12967}
12968impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
12969 fn default() -> Self {
12970 Self::DEFAULT.clone()
12971 }
12972}
12973impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
12974 type Message = MavMessage;
12975 const ID: u32 = 280u32;
12976 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
12977 const EXTRA_CRC: u8 = 70u8;
12978 const ENCODED_LEN: usize = 33usize;
12979 fn deser(
12980 _version: MavlinkVersion,
12981 __input: &[u8],
12982 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12983 let avail_len = __input.len();
12984 let mut payload_buf = [0; Self::ENCODED_LEN];
12985 let mut buf = if avail_len < Self::ENCODED_LEN {
12986 payload_buf[0..avail_len].copy_from_slice(__input);
12987 Bytes::new(&payload_buf)
12988 } else {
12989 Bytes::new(__input)
12990 };
12991 let mut __struct = Self::default();
12992 __struct.time_boot_ms = buf.get_u32_le();
12993 let tmp = buf.get_u32_le();
12994 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
12995 tmp as <GimbalManagerCapFlags as Flags>::Bits,
12996 )
12997 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12998 flag_type: "GimbalManagerCapFlags",
12999 value: tmp as u64,
13000 })?;
13001 __struct.roll_min = buf.get_f32_le();
13002 __struct.roll_max = buf.get_f32_le();
13003 __struct.pitch_min = buf.get_f32_le();
13004 __struct.pitch_max = buf.get_f32_le();
13005 __struct.yaw_min = buf.get_f32_le();
13006 __struct.yaw_max = buf.get_f32_le();
13007 __struct.gimbal_device_id = buf.get_u8();
13008 Ok(__struct)
13009 }
13010 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13011 let mut __tmp = BytesMut::new(bytes);
13012 #[allow(clippy::absurd_extreme_comparisons)]
13013 #[allow(unused_comparisons)]
13014 if __tmp.remaining() < Self::ENCODED_LEN {
13015 panic!(
13016 "buffer is too small (need {} bytes, but got {})",
13017 Self::ENCODED_LEN,
13018 __tmp.remaining(),
13019 )
13020 }
13021 __tmp.put_u32_le(self.time_boot_ms);
13022 __tmp.put_u32_le(self.cap_flags.bits() as u32);
13023 __tmp.put_f32_le(self.roll_min);
13024 __tmp.put_f32_le(self.roll_max);
13025 __tmp.put_f32_le(self.pitch_min);
13026 __tmp.put_f32_le(self.pitch_max);
13027 __tmp.put_f32_le(self.yaw_min);
13028 __tmp.put_f32_le(self.yaw_max);
13029 __tmp.put_u8(self.gimbal_device_id);
13030 if matches!(version, MavlinkVersion::V2) {
13031 let len = __tmp.len();
13032 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13033 } else {
13034 __tmp.len()
13035 }
13036 }
13037}
13038#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13039#[doc = ""]
13040#[doc = "ID: 282"]
13041#[derive(Debug, Clone, PartialEq)]
13042#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13043#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13044#[cfg_attr(feature = "ts", derive(TS))]
13045#[cfg_attr(feature = "ts", ts(export))]
13046pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13047 #[doc = "High level gimbal manager flags to use."]
13048 pub flags: GimbalManagerFlags,
13049 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
13050 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13051 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13052 pub q: [f32; 4],
13053 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
13054 pub angular_velocity_x: f32,
13055 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
13056 pub angular_velocity_y: f32,
13057 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
13058 pub angular_velocity_z: f32,
13059 #[doc = "System ID"]
13060 pub target_system: u8,
13061 #[doc = "Component ID"]
13062 pub target_component: u8,
13063 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13064 pub gimbal_device_id: u8,
13065}
13066impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13067 pub const ENCODED_LEN: usize = 35usize;
13068 pub const DEFAULT: Self = Self {
13069 flags: GimbalManagerFlags::DEFAULT,
13070 q: [0.0_f32; 4usize],
13071 angular_velocity_x: 0.0_f32,
13072 angular_velocity_y: 0.0_f32,
13073 angular_velocity_z: 0.0_f32,
13074 target_system: 0_u8,
13075 target_component: 0_u8,
13076 gimbal_device_id: 0_u8,
13077 };
13078 #[cfg(feature = "arbitrary")]
13079 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13080 use arbitrary::{Arbitrary, Unstructured};
13081 let mut buf = [0u8; 1024];
13082 rng.fill_bytes(&mut buf);
13083 let mut unstructured = Unstructured::new(&buf);
13084 Self::arbitrary(&mut unstructured).unwrap_or_default()
13085 }
13086}
13087impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13088 fn default() -> Self {
13089 Self::DEFAULT.clone()
13090 }
13091}
13092impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13093 type Message = MavMessage;
13094 const ID: u32 = 282u32;
13095 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
13096 const EXTRA_CRC: u8 = 123u8;
13097 const ENCODED_LEN: usize = 35usize;
13098 fn deser(
13099 _version: MavlinkVersion,
13100 __input: &[u8],
13101 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13102 let avail_len = __input.len();
13103 let mut payload_buf = [0; Self::ENCODED_LEN];
13104 let mut buf = if avail_len < Self::ENCODED_LEN {
13105 payload_buf[0..avail_len].copy_from_slice(__input);
13106 Bytes::new(&payload_buf)
13107 } else {
13108 Bytes::new(__input)
13109 };
13110 let mut __struct = Self::default();
13111 let tmp = buf.get_u32_le();
13112 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13113 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13114 flag_type: "GimbalManagerFlags",
13115 value: tmp as u64,
13116 })?;
13117 for v in &mut __struct.q {
13118 let val = buf.get_f32_le();
13119 *v = val;
13120 }
13121 __struct.angular_velocity_x = buf.get_f32_le();
13122 __struct.angular_velocity_y = buf.get_f32_le();
13123 __struct.angular_velocity_z = buf.get_f32_le();
13124 __struct.target_system = buf.get_u8();
13125 __struct.target_component = buf.get_u8();
13126 __struct.gimbal_device_id = buf.get_u8();
13127 Ok(__struct)
13128 }
13129 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13130 let mut __tmp = BytesMut::new(bytes);
13131 #[allow(clippy::absurd_extreme_comparisons)]
13132 #[allow(unused_comparisons)]
13133 if __tmp.remaining() < Self::ENCODED_LEN {
13134 panic!(
13135 "buffer is too small (need {} bytes, but got {})",
13136 Self::ENCODED_LEN,
13137 __tmp.remaining(),
13138 )
13139 }
13140 __tmp.put_u32_le(self.flags.bits() as u32);
13141 for val in &self.q {
13142 __tmp.put_f32_le(*val);
13143 }
13144 __tmp.put_f32_le(self.angular_velocity_x);
13145 __tmp.put_f32_le(self.angular_velocity_y);
13146 __tmp.put_f32_le(self.angular_velocity_z);
13147 __tmp.put_u8(self.target_system);
13148 __tmp.put_u8(self.target_component);
13149 __tmp.put_u8(self.gimbal_device_id);
13150 if matches!(version, MavlinkVersion::V2) {
13151 let len = __tmp.len();
13152 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13153 } else {
13154 __tmp.len()
13155 }
13156 }
13157}
13158#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13159#[doc = ""]
13160#[doc = "ID: 288"]
13161#[derive(Debug, Clone, PartialEq)]
13162#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13163#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13164#[cfg_attr(feature = "ts", derive(TS))]
13165#[cfg_attr(feature = "ts", ts(export))]
13166pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13167 #[doc = "High level gimbal manager flags."]
13168 pub flags: GimbalManagerFlags,
13169 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13170 pub pitch: f32,
13171 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13172 pub yaw: f32,
13173 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13174 pub pitch_rate: f32,
13175 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13176 pub yaw_rate: f32,
13177 #[doc = "System ID"]
13178 pub target_system: u8,
13179 #[doc = "Component ID"]
13180 pub target_component: u8,
13181 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13182 pub gimbal_device_id: u8,
13183}
13184impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13185 pub const ENCODED_LEN: usize = 23usize;
13186 pub const DEFAULT: Self = Self {
13187 flags: GimbalManagerFlags::DEFAULT,
13188 pitch: 0.0_f32,
13189 yaw: 0.0_f32,
13190 pitch_rate: 0.0_f32,
13191 yaw_rate: 0.0_f32,
13192 target_system: 0_u8,
13193 target_component: 0_u8,
13194 gimbal_device_id: 0_u8,
13195 };
13196 #[cfg(feature = "arbitrary")]
13197 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13198 use arbitrary::{Arbitrary, Unstructured};
13199 let mut buf = [0u8; 1024];
13200 rng.fill_bytes(&mut buf);
13201 let mut unstructured = Unstructured::new(&buf);
13202 Self::arbitrary(&mut unstructured).unwrap_or_default()
13203 }
13204}
13205impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13206 fn default() -> Self {
13207 Self::DEFAULT.clone()
13208 }
13209}
13210impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13211 type Message = MavMessage;
13212 const ID: u32 = 288u32;
13213 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
13214 const EXTRA_CRC: u8 = 20u8;
13215 const ENCODED_LEN: usize = 23usize;
13216 fn deser(
13217 _version: MavlinkVersion,
13218 __input: &[u8],
13219 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13220 let avail_len = __input.len();
13221 let mut payload_buf = [0; Self::ENCODED_LEN];
13222 let mut buf = if avail_len < Self::ENCODED_LEN {
13223 payload_buf[0..avail_len].copy_from_slice(__input);
13224 Bytes::new(&payload_buf)
13225 } else {
13226 Bytes::new(__input)
13227 };
13228 let mut __struct = Self::default();
13229 let tmp = buf.get_u32_le();
13230 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13231 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13232 flag_type: "GimbalManagerFlags",
13233 value: tmp as u64,
13234 })?;
13235 __struct.pitch = buf.get_f32_le();
13236 __struct.yaw = buf.get_f32_le();
13237 __struct.pitch_rate = buf.get_f32_le();
13238 __struct.yaw_rate = buf.get_f32_le();
13239 __struct.target_system = buf.get_u8();
13240 __struct.target_component = buf.get_u8();
13241 __struct.gimbal_device_id = buf.get_u8();
13242 Ok(__struct)
13243 }
13244 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13245 let mut __tmp = BytesMut::new(bytes);
13246 #[allow(clippy::absurd_extreme_comparisons)]
13247 #[allow(unused_comparisons)]
13248 if __tmp.remaining() < Self::ENCODED_LEN {
13249 panic!(
13250 "buffer is too small (need {} bytes, but got {})",
13251 Self::ENCODED_LEN,
13252 __tmp.remaining(),
13253 )
13254 }
13255 __tmp.put_u32_le(self.flags.bits() as u32);
13256 __tmp.put_f32_le(self.pitch);
13257 __tmp.put_f32_le(self.yaw);
13258 __tmp.put_f32_le(self.pitch_rate);
13259 __tmp.put_f32_le(self.yaw_rate);
13260 __tmp.put_u8(self.target_system);
13261 __tmp.put_u8(self.target_component);
13262 __tmp.put_u8(self.gimbal_device_id);
13263 if matches!(version, MavlinkVersion::V2) {
13264 let len = __tmp.len();
13265 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13266 } else {
13267 __tmp.len()
13268 }
13269 }
13270}
13271#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
13272#[doc = ""]
13273#[doc = "ID: 287"]
13274#[derive(Debug, Clone, PartialEq)]
13275#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13276#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13277#[cfg_attr(feature = "ts", derive(TS))]
13278#[cfg_attr(feature = "ts", ts(export))]
13279pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13280 #[doc = "High level gimbal manager flags to use."]
13281 pub flags: GimbalManagerFlags,
13282 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
13283 pub pitch: f32,
13284 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
13285 pub yaw: f32,
13286 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
13287 pub pitch_rate: f32,
13288 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
13289 pub yaw_rate: f32,
13290 #[doc = "System ID"]
13291 pub target_system: u8,
13292 #[doc = "Component ID"]
13293 pub target_component: u8,
13294 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13295 pub gimbal_device_id: u8,
13296}
13297impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13298 pub const ENCODED_LEN: usize = 23usize;
13299 pub const DEFAULT: Self = Self {
13300 flags: GimbalManagerFlags::DEFAULT,
13301 pitch: 0.0_f32,
13302 yaw: 0.0_f32,
13303 pitch_rate: 0.0_f32,
13304 yaw_rate: 0.0_f32,
13305 target_system: 0_u8,
13306 target_component: 0_u8,
13307 gimbal_device_id: 0_u8,
13308 };
13309 #[cfg(feature = "arbitrary")]
13310 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13311 use arbitrary::{Arbitrary, Unstructured};
13312 let mut buf = [0u8; 1024];
13313 rng.fill_bytes(&mut buf);
13314 let mut unstructured = Unstructured::new(&buf);
13315 Self::arbitrary(&mut unstructured).unwrap_or_default()
13316 }
13317}
13318impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13319 fn default() -> Self {
13320 Self::DEFAULT.clone()
13321 }
13322}
13323impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13324 type Message = MavMessage;
13325 const ID: u32 = 287u32;
13326 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
13327 const EXTRA_CRC: u8 = 1u8;
13328 const ENCODED_LEN: usize = 23usize;
13329 fn deser(
13330 _version: MavlinkVersion,
13331 __input: &[u8],
13332 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13333 let avail_len = __input.len();
13334 let mut payload_buf = [0; Self::ENCODED_LEN];
13335 let mut buf = if avail_len < Self::ENCODED_LEN {
13336 payload_buf[0..avail_len].copy_from_slice(__input);
13337 Bytes::new(&payload_buf)
13338 } else {
13339 Bytes::new(__input)
13340 };
13341 let mut __struct = Self::default();
13342 let tmp = buf.get_u32_le();
13343 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13344 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13345 flag_type: "GimbalManagerFlags",
13346 value: tmp as u64,
13347 })?;
13348 __struct.pitch = buf.get_f32_le();
13349 __struct.yaw = buf.get_f32_le();
13350 __struct.pitch_rate = buf.get_f32_le();
13351 __struct.yaw_rate = buf.get_f32_le();
13352 __struct.target_system = buf.get_u8();
13353 __struct.target_component = buf.get_u8();
13354 __struct.gimbal_device_id = buf.get_u8();
13355 Ok(__struct)
13356 }
13357 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13358 let mut __tmp = BytesMut::new(bytes);
13359 #[allow(clippy::absurd_extreme_comparisons)]
13360 #[allow(unused_comparisons)]
13361 if __tmp.remaining() < Self::ENCODED_LEN {
13362 panic!(
13363 "buffer is too small (need {} bytes, but got {})",
13364 Self::ENCODED_LEN,
13365 __tmp.remaining(),
13366 )
13367 }
13368 __tmp.put_u32_le(self.flags.bits() as u32);
13369 __tmp.put_f32_le(self.pitch);
13370 __tmp.put_f32_le(self.yaw);
13371 __tmp.put_f32_le(self.pitch_rate);
13372 __tmp.put_f32_le(self.yaw_rate);
13373 __tmp.put_u8(self.target_system);
13374 __tmp.put_u8(self.target_component);
13375 __tmp.put_u8(self.gimbal_device_id);
13376 if matches!(version, MavlinkVersion::V2) {
13377 let len = __tmp.len();
13378 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13379 } else {
13380 __tmp.len()
13381 }
13382 }
13383}
13384#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
13385#[doc = ""]
13386#[doc = "ID: 281"]
13387#[derive(Debug, Clone, PartialEq)]
13388#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13389#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13390#[cfg_attr(feature = "ts", derive(TS))]
13391#[cfg_attr(feature = "ts", ts(export))]
13392pub struct GIMBAL_MANAGER_STATUS_DATA {
13393 #[doc = "Timestamp (time since system boot)."]
13394 pub time_boot_ms: u32,
13395 #[doc = "High level gimbal manager flags currently applied."]
13396 pub flags: GimbalManagerFlags,
13397 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13398 pub gimbal_device_id: u8,
13399 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
13400 pub primary_control_sysid: u8,
13401 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
13402 pub primary_control_compid: u8,
13403 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
13404 pub secondary_control_sysid: u8,
13405 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
13406 pub secondary_control_compid: u8,
13407}
13408impl GIMBAL_MANAGER_STATUS_DATA {
13409 pub const ENCODED_LEN: usize = 13usize;
13410 pub const DEFAULT: Self = Self {
13411 time_boot_ms: 0_u32,
13412 flags: GimbalManagerFlags::DEFAULT,
13413 gimbal_device_id: 0_u8,
13414 primary_control_sysid: 0_u8,
13415 primary_control_compid: 0_u8,
13416 secondary_control_sysid: 0_u8,
13417 secondary_control_compid: 0_u8,
13418 };
13419 #[cfg(feature = "arbitrary")]
13420 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13421 use arbitrary::{Arbitrary, Unstructured};
13422 let mut buf = [0u8; 1024];
13423 rng.fill_bytes(&mut buf);
13424 let mut unstructured = Unstructured::new(&buf);
13425 Self::arbitrary(&mut unstructured).unwrap_or_default()
13426 }
13427}
13428impl Default for GIMBAL_MANAGER_STATUS_DATA {
13429 fn default() -> Self {
13430 Self::DEFAULT.clone()
13431 }
13432}
13433impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
13434 type Message = MavMessage;
13435 const ID: u32 = 281u32;
13436 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
13437 const EXTRA_CRC: u8 = 48u8;
13438 const ENCODED_LEN: usize = 13usize;
13439 fn deser(
13440 _version: MavlinkVersion,
13441 __input: &[u8],
13442 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13443 let avail_len = __input.len();
13444 let mut payload_buf = [0; Self::ENCODED_LEN];
13445 let mut buf = if avail_len < Self::ENCODED_LEN {
13446 payload_buf[0..avail_len].copy_from_slice(__input);
13447 Bytes::new(&payload_buf)
13448 } else {
13449 Bytes::new(__input)
13450 };
13451 let mut __struct = Self::default();
13452 __struct.time_boot_ms = buf.get_u32_le();
13453 let tmp = buf.get_u32_le();
13454 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13455 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13456 flag_type: "GimbalManagerFlags",
13457 value: tmp as u64,
13458 })?;
13459 __struct.gimbal_device_id = buf.get_u8();
13460 __struct.primary_control_sysid = buf.get_u8();
13461 __struct.primary_control_compid = buf.get_u8();
13462 __struct.secondary_control_sysid = buf.get_u8();
13463 __struct.secondary_control_compid = buf.get_u8();
13464 Ok(__struct)
13465 }
13466 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13467 let mut __tmp = BytesMut::new(bytes);
13468 #[allow(clippy::absurd_extreme_comparisons)]
13469 #[allow(unused_comparisons)]
13470 if __tmp.remaining() < Self::ENCODED_LEN {
13471 panic!(
13472 "buffer is too small (need {} bytes, but got {})",
13473 Self::ENCODED_LEN,
13474 __tmp.remaining(),
13475 )
13476 }
13477 __tmp.put_u32_le(self.time_boot_ms);
13478 __tmp.put_u32_le(self.flags.bits() as u32);
13479 __tmp.put_u8(self.gimbal_device_id);
13480 __tmp.put_u8(self.primary_control_sysid);
13481 __tmp.put_u8(self.primary_control_compid);
13482 __tmp.put_u8(self.secondary_control_sysid);
13483 __tmp.put_u8(self.secondary_control_compid);
13484 if matches!(version, MavlinkVersion::V2) {
13485 let len = __tmp.len();
13486 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13487 } else {
13488 __tmp.len()
13489 }
13490 }
13491}
13492#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
13493#[doc = ""]
13494#[doc = "ID: 33"]
13495#[derive(Debug, Clone, PartialEq)]
13496#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13497#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13498#[cfg_attr(feature = "ts", derive(TS))]
13499#[cfg_attr(feature = "ts", ts(export))]
13500pub struct GLOBAL_POSITION_INT_DATA {
13501 #[doc = "Timestamp (time since system boot)."]
13502 pub time_boot_ms: u32,
13503 #[doc = "Latitude, expressed"]
13504 pub lat: i32,
13505 #[doc = "Longitude, expressed"]
13506 pub lon: i32,
13507 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
13508 pub alt: i32,
13509 #[doc = "Altitude above home"]
13510 pub relative_alt: i32,
13511 #[doc = "Ground X Speed (Latitude, positive north)"]
13512 pub vx: i16,
13513 #[doc = "Ground Y Speed (Longitude, positive east)"]
13514 pub vy: i16,
13515 #[doc = "Ground Z Speed (Altitude, positive down)"]
13516 pub vz: i16,
13517 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13518 pub hdg: u16,
13519}
13520impl GLOBAL_POSITION_INT_DATA {
13521 pub const ENCODED_LEN: usize = 28usize;
13522 pub const DEFAULT: Self = Self {
13523 time_boot_ms: 0_u32,
13524 lat: 0_i32,
13525 lon: 0_i32,
13526 alt: 0_i32,
13527 relative_alt: 0_i32,
13528 vx: 0_i16,
13529 vy: 0_i16,
13530 vz: 0_i16,
13531 hdg: 0_u16,
13532 };
13533 #[cfg(feature = "arbitrary")]
13534 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13535 use arbitrary::{Arbitrary, Unstructured};
13536 let mut buf = [0u8; 1024];
13537 rng.fill_bytes(&mut buf);
13538 let mut unstructured = Unstructured::new(&buf);
13539 Self::arbitrary(&mut unstructured).unwrap_or_default()
13540 }
13541}
13542impl Default for GLOBAL_POSITION_INT_DATA {
13543 fn default() -> Self {
13544 Self::DEFAULT.clone()
13545 }
13546}
13547impl MessageData for GLOBAL_POSITION_INT_DATA {
13548 type Message = MavMessage;
13549 const ID: u32 = 33u32;
13550 const NAME: &'static str = "GLOBAL_POSITION_INT";
13551 const EXTRA_CRC: u8 = 104u8;
13552 const ENCODED_LEN: usize = 28usize;
13553 fn deser(
13554 _version: MavlinkVersion,
13555 __input: &[u8],
13556 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13557 let avail_len = __input.len();
13558 let mut payload_buf = [0; Self::ENCODED_LEN];
13559 let mut buf = if avail_len < Self::ENCODED_LEN {
13560 payload_buf[0..avail_len].copy_from_slice(__input);
13561 Bytes::new(&payload_buf)
13562 } else {
13563 Bytes::new(__input)
13564 };
13565 let mut __struct = Self::default();
13566 __struct.time_boot_ms = buf.get_u32_le();
13567 __struct.lat = buf.get_i32_le();
13568 __struct.lon = buf.get_i32_le();
13569 __struct.alt = buf.get_i32_le();
13570 __struct.relative_alt = buf.get_i32_le();
13571 __struct.vx = buf.get_i16_le();
13572 __struct.vy = buf.get_i16_le();
13573 __struct.vz = buf.get_i16_le();
13574 __struct.hdg = buf.get_u16_le();
13575 Ok(__struct)
13576 }
13577 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13578 let mut __tmp = BytesMut::new(bytes);
13579 #[allow(clippy::absurd_extreme_comparisons)]
13580 #[allow(unused_comparisons)]
13581 if __tmp.remaining() < Self::ENCODED_LEN {
13582 panic!(
13583 "buffer is too small (need {} bytes, but got {})",
13584 Self::ENCODED_LEN,
13585 __tmp.remaining(),
13586 )
13587 }
13588 __tmp.put_u32_le(self.time_boot_ms);
13589 __tmp.put_i32_le(self.lat);
13590 __tmp.put_i32_le(self.lon);
13591 __tmp.put_i32_le(self.alt);
13592 __tmp.put_i32_le(self.relative_alt);
13593 __tmp.put_i16_le(self.vx);
13594 __tmp.put_i16_le(self.vy);
13595 __tmp.put_i16_le(self.vz);
13596 __tmp.put_u16_le(self.hdg);
13597 if matches!(version, MavlinkVersion::V2) {
13598 let len = __tmp.len();
13599 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13600 } else {
13601 __tmp.len()
13602 }
13603 }
13604}
13605#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
13606#[doc = ""]
13607#[doc = "ID: 63"]
13608#[derive(Debug, Clone, PartialEq)]
13609#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13610#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13611#[cfg_attr(feature = "ts", derive(TS))]
13612#[cfg_attr(feature = "ts", ts(export))]
13613pub struct GLOBAL_POSITION_INT_COV_DATA {
13614 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13615 pub time_usec: u64,
13616 #[doc = "Latitude"]
13617 pub lat: i32,
13618 #[doc = "Longitude"]
13619 pub lon: i32,
13620 #[doc = "Altitude in meters above MSL"]
13621 pub alt: i32,
13622 #[doc = "Altitude above ground"]
13623 pub relative_alt: i32,
13624 #[doc = "Ground X Speed (Latitude)"]
13625 pub vx: f32,
13626 #[doc = "Ground Y Speed (Longitude)"]
13627 pub vy: f32,
13628 #[doc = "Ground Z Speed (Altitude)"]
13629 pub vz: f32,
13630 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
13631 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13632 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13633 pub covariance: [f32; 36],
13634 #[doc = "Class id of the estimator this estimate originated from."]
13635 pub estimator_type: MavEstimatorType,
13636}
13637impl GLOBAL_POSITION_INT_COV_DATA {
13638 pub const ENCODED_LEN: usize = 181usize;
13639 pub const DEFAULT: Self = Self {
13640 time_usec: 0_u64,
13641 lat: 0_i32,
13642 lon: 0_i32,
13643 alt: 0_i32,
13644 relative_alt: 0_i32,
13645 vx: 0.0_f32,
13646 vy: 0.0_f32,
13647 vz: 0.0_f32,
13648 covariance: [0.0_f32; 36usize],
13649 estimator_type: MavEstimatorType::DEFAULT,
13650 };
13651 #[cfg(feature = "arbitrary")]
13652 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13653 use arbitrary::{Arbitrary, Unstructured};
13654 let mut buf = [0u8; 1024];
13655 rng.fill_bytes(&mut buf);
13656 let mut unstructured = Unstructured::new(&buf);
13657 Self::arbitrary(&mut unstructured).unwrap_or_default()
13658 }
13659}
13660impl Default for GLOBAL_POSITION_INT_COV_DATA {
13661 fn default() -> Self {
13662 Self::DEFAULT.clone()
13663 }
13664}
13665impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
13666 type Message = MavMessage;
13667 const ID: u32 = 63u32;
13668 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
13669 const EXTRA_CRC: u8 = 119u8;
13670 const ENCODED_LEN: usize = 181usize;
13671 fn deser(
13672 _version: MavlinkVersion,
13673 __input: &[u8],
13674 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13675 let avail_len = __input.len();
13676 let mut payload_buf = [0; Self::ENCODED_LEN];
13677 let mut buf = if avail_len < Self::ENCODED_LEN {
13678 payload_buf[0..avail_len].copy_from_slice(__input);
13679 Bytes::new(&payload_buf)
13680 } else {
13681 Bytes::new(__input)
13682 };
13683 let mut __struct = Self::default();
13684 __struct.time_usec = buf.get_u64_le();
13685 __struct.lat = buf.get_i32_le();
13686 __struct.lon = buf.get_i32_le();
13687 __struct.alt = buf.get_i32_le();
13688 __struct.relative_alt = buf.get_i32_le();
13689 __struct.vx = buf.get_f32_le();
13690 __struct.vy = buf.get_f32_le();
13691 __struct.vz = buf.get_f32_le();
13692 for v in &mut __struct.covariance {
13693 let val = buf.get_f32_le();
13694 *v = val;
13695 }
13696 let tmp = buf.get_u8();
13697 __struct.estimator_type =
13698 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13699 enum_type: "MavEstimatorType",
13700 value: tmp as u64,
13701 })?;
13702 Ok(__struct)
13703 }
13704 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13705 let mut __tmp = BytesMut::new(bytes);
13706 #[allow(clippy::absurd_extreme_comparisons)]
13707 #[allow(unused_comparisons)]
13708 if __tmp.remaining() < Self::ENCODED_LEN {
13709 panic!(
13710 "buffer is too small (need {} bytes, but got {})",
13711 Self::ENCODED_LEN,
13712 __tmp.remaining(),
13713 )
13714 }
13715 __tmp.put_u64_le(self.time_usec);
13716 __tmp.put_i32_le(self.lat);
13717 __tmp.put_i32_le(self.lon);
13718 __tmp.put_i32_le(self.alt);
13719 __tmp.put_i32_le(self.relative_alt);
13720 __tmp.put_f32_le(self.vx);
13721 __tmp.put_f32_le(self.vy);
13722 __tmp.put_f32_le(self.vz);
13723 for val in &self.covariance {
13724 __tmp.put_f32_le(*val);
13725 }
13726 __tmp.put_u8(self.estimator_type as u8);
13727 if matches!(version, MavlinkVersion::V2) {
13728 let len = __tmp.len();
13729 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13730 } else {
13731 __tmp.len()
13732 }
13733 }
13734}
13735#[doc = "Global position/attitude estimate from a vision source."]
13736#[doc = ""]
13737#[doc = "ID: 101"]
13738#[derive(Debug, Clone, PartialEq)]
13739#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13740#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13741#[cfg_attr(feature = "ts", derive(TS))]
13742#[cfg_attr(feature = "ts", ts(export))]
13743pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13744 #[doc = "Timestamp (UNIX time or since system boot)"]
13745 pub usec: u64,
13746 #[doc = "Global X position"]
13747 pub x: f32,
13748 #[doc = "Global Y position"]
13749 pub y: f32,
13750 #[doc = "Global Z position"]
13751 pub z: f32,
13752 #[doc = "Roll angle"]
13753 pub roll: f32,
13754 #[doc = "Pitch angle"]
13755 pub pitch: f32,
13756 #[doc = "Yaw angle"]
13757 pub yaw: f32,
13758 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
13759 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13760 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13761 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13762 pub covariance: [f32; 21],
13763 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
13764 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13765 pub reset_counter: u8,
13766}
13767impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13768 pub const ENCODED_LEN: usize = 117usize;
13769 pub const DEFAULT: Self = Self {
13770 usec: 0_u64,
13771 x: 0.0_f32,
13772 y: 0.0_f32,
13773 z: 0.0_f32,
13774 roll: 0.0_f32,
13775 pitch: 0.0_f32,
13776 yaw: 0.0_f32,
13777 covariance: [0.0_f32; 21usize],
13778 reset_counter: 0_u8,
13779 };
13780 #[cfg(feature = "arbitrary")]
13781 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13782 use arbitrary::{Arbitrary, Unstructured};
13783 let mut buf = [0u8; 1024];
13784 rng.fill_bytes(&mut buf);
13785 let mut unstructured = Unstructured::new(&buf);
13786 Self::arbitrary(&mut unstructured).unwrap_or_default()
13787 }
13788}
13789impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13790 fn default() -> Self {
13791 Self::DEFAULT.clone()
13792 }
13793}
13794impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13795 type Message = MavMessage;
13796 const ID: u32 = 101u32;
13797 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
13798 const EXTRA_CRC: u8 = 102u8;
13799 const ENCODED_LEN: usize = 117usize;
13800 fn deser(
13801 _version: MavlinkVersion,
13802 __input: &[u8],
13803 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13804 let avail_len = __input.len();
13805 let mut payload_buf = [0; Self::ENCODED_LEN];
13806 let mut buf = if avail_len < Self::ENCODED_LEN {
13807 payload_buf[0..avail_len].copy_from_slice(__input);
13808 Bytes::new(&payload_buf)
13809 } else {
13810 Bytes::new(__input)
13811 };
13812 let mut __struct = Self::default();
13813 __struct.usec = buf.get_u64_le();
13814 __struct.x = buf.get_f32_le();
13815 __struct.y = buf.get_f32_le();
13816 __struct.z = buf.get_f32_le();
13817 __struct.roll = buf.get_f32_le();
13818 __struct.pitch = buf.get_f32_le();
13819 __struct.yaw = buf.get_f32_le();
13820 for v in &mut __struct.covariance {
13821 let val = buf.get_f32_le();
13822 *v = val;
13823 }
13824 __struct.reset_counter = buf.get_u8();
13825 Ok(__struct)
13826 }
13827 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13828 let mut __tmp = BytesMut::new(bytes);
13829 #[allow(clippy::absurd_extreme_comparisons)]
13830 #[allow(unused_comparisons)]
13831 if __tmp.remaining() < Self::ENCODED_LEN {
13832 panic!(
13833 "buffer is too small (need {} bytes, but got {})",
13834 Self::ENCODED_LEN,
13835 __tmp.remaining(),
13836 )
13837 }
13838 __tmp.put_u64_le(self.usec);
13839 __tmp.put_f32_le(self.x);
13840 __tmp.put_f32_le(self.y);
13841 __tmp.put_f32_le(self.z);
13842 __tmp.put_f32_le(self.roll);
13843 __tmp.put_f32_le(self.pitch);
13844 __tmp.put_f32_le(self.yaw);
13845 if matches!(version, MavlinkVersion::V2) {
13846 for val in &self.covariance {
13847 __tmp.put_f32_le(*val);
13848 }
13849 __tmp.put_u8(self.reset_counter);
13850 let len = __tmp.len();
13851 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13852 } else {
13853 __tmp.len()
13854 }
13855 }
13856}
13857#[doc = "Second GPS data."]
13858#[doc = ""]
13859#[doc = "ID: 124"]
13860#[derive(Debug, Clone, PartialEq)]
13861#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13862#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13863#[cfg_attr(feature = "ts", derive(TS))]
13864#[cfg_attr(feature = "ts", ts(export))]
13865pub struct GPS2_RAW_DATA {
13866 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13867 pub time_usec: u64,
13868 #[doc = "Latitude (WGS84)"]
13869 pub lat: i32,
13870 #[doc = "Longitude (WGS84)"]
13871 pub lon: i32,
13872 #[doc = "Altitude (MSL). Positive for up."]
13873 pub alt: i32,
13874 #[doc = "Age of DGPS info"]
13875 pub dgps_age: u32,
13876 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13877 pub eph: u16,
13878 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13879 pub epv: u16,
13880 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13881 pub vel: u16,
13882 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13883 pub cog: u16,
13884 #[doc = "GPS fix type."]
13885 pub fix_type: GpsFixType,
13886 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13887 pub satellites_visible: u8,
13888 #[doc = "Number of DGPS satellites"]
13889 pub dgps_numch: u8,
13890 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13891 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13892 pub yaw: u16,
13893 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13894 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13895 pub alt_ellipsoid: i32,
13896 #[doc = "Position uncertainty."]
13897 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13898 pub h_acc: u32,
13899 #[doc = "Altitude uncertainty."]
13900 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13901 pub v_acc: u32,
13902 #[doc = "Speed uncertainty."]
13903 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13904 pub vel_acc: u32,
13905 #[doc = "Heading / track uncertainty"]
13906 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13907 pub hdg_acc: u32,
13908}
13909impl GPS2_RAW_DATA {
13910 pub const ENCODED_LEN: usize = 57usize;
13911 pub const DEFAULT: Self = Self {
13912 time_usec: 0_u64,
13913 lat: 0_i32,
13914 lon: 0_i32,
13915 alt: 0_i32,
13916 dgps_age: 0_u32,
13917 eph: 0_u16,
13918 epv: 0_u16,
13919 vel: 0_u16,
13920 cog: 0_u16,
13921 fix_type: GpsFixType::DEFAULT,
13922 satellites_visible: 0_u8,
13923 dgps_numch: 0_u8,
13924 yaw: 0_u16,
13925 alt_ellipsoid: 0_i32,
13926 h_acc: 0_u32,
13927 v_acc: 0_u32,
13928 vel_acc: 0_u32,
13929 hdg_acc: 0_u32,
13930 };
13931 #[cfg(feature = "arbitrary")]
13932 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13933 use arbitrary::{Arbitrary, Unstructured};
13934 let mut buf = [0u8; 1024];
13935 rng.fill_bytes(&mut buf);
13936 let mut unstructured = Unstructured::new(&buf);
13937 Self::arbitrary(&mut unstructured).unwrap_or_default()
13938 }
13939}
13940impl Default for GPS2_RAW_DATA {
13941 fn default() -> Self {
13942 Self::DEFAULT.clone()
13943 }
13944}
13945impl MessageData for GPS2_RAW_DATA {
13946 type Message = MavMessage;
13947 const ID: u32 = 124u32;
13948 const NAME: &'static str = "GPS2_RAW";
13949 const EXTRA_CRC: u8 = 87u8;
13950 const ENCODED_LEN: usize = 57usize;
13951 fn deser(
13952 _version: MavlinkVersion,
13953 __input: &[u8],
13954 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13955 let avail_len = __input.len();
13956 let mut payload_buf = [0; Self::ENCODED_LEN];
13957 let mut buf = if avail_len < Self::ENCODED_LEN {
13958 payload_buf[0..avail_len].copy_from_slice(__input);
13959 Bytes::new(&payload_buf)
13960 } else {
13961 Bytes::new(__input)
13962 };
13963 let mut __struct = Self::default();
13964 __struct.time_usec = buf.get_u64_le();
13965 __struct.lat = buf.get_i32_le();
13966 __struct.lon = buf.get_i32_le();
13967 __struct.alt = buf.get_i32_le();
13968 __struct.dgps_age = buf.get_u32_le();
13969 __struct.eph = buf.get_u16_le();
13970 __struct.epv = buf.get_u16_le();
13971 __struct.vel = buf.get_u16_le();
13972 __struct.cog = buf.get_u16_le();
13973 let tmp = buf.get_u8();
13974 __struct.fix_type =
13975 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13976 enum_type: "GpsFixType",
13977 value: tmp as u64,
13978 })?;
13979 __struct.satellites_visible = buf.get_u8();
13980 __struct.dgps_numch = buf.get_u8();
13981 __struct.yaw = buf.get_u16_le();
13982 __struct.alt_ellipsoid = buf.get_i32_le();
13983 __struct.h_acc = buf.get_u32_le();
13984 __struct.v_acc = buf.get_u32_le();
13985 __struct.vel_acc = buf.get_u32_le();
13986 __struct.hdg_acc = buf.get_u32_le();
13987 Ok(__struct)
13988 }
13989 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13990 let mut __tmp = BytesMut::new(bytes);
13991 #[allow(clippy::absurd_extreme_comparisons)]
13992 #[allow(unused_comparisons)]
13993 if __tmp.remaining() < Self::ENCODED_LEN {
13994 panic!(
13995 "buffer is too small (need {} bytes, but got {})",
13996 Self::ENCODED_LEN,
13997 __tmp.remaining(),
13998 )
13999 }
14000 __tmp.put_u64_le(self.time_usec);
14001 __tmp.put_i32_le(self.lat);
14002 __tmp.put_i32_le(self.lon);
14003 __tmp.put_i32_le(self.alt);
14004 __tmp.put_u32_le(self.dgps_age);
14005 __tmp.put_u16_le(self.eph);
14006 __tmp.put_u16_le(self.epv);
14007 __tmp.put_u16_le(self.vel);
14008 __tmp.put_u16_le(self.cog);
14009 __tmp.put_u8(self.fix_type as u8);
14010 __tmp.put_u8(self.satellites_visible);
14011 __tmp.put_u8(self.dgps_numch);
14012 if matches!(version, MavlinkVersion::V2) {
14013 __tmp.put_u16_le(self.yaw);
14014 __tmp.put_i32_le(self.alt_ellipsoid);
14015 __tmp.put_u32_le(self.h_acc);
14016 __tmp.put_u32_le(self.v_acc);
14017 __tmp.put_u32_le(self.vel_acc);
14018 __tmp.put_u32_le(self.hdg_acc);
14019 let len = __tmp.len();
14020 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14021 } else {
14022 __tmp.len()
14023 }
14024 }
14025}
14026#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14027#[doc = ""]
14028#[doc = "ID: 128"]
14029#[derive(Debug, Clone, PartialEq)]
14030#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14031#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14032#[cfg_attr(feature = "ts", derive(TS))]
14033#[cfg_attr(feature = "ts", ts(export))]
14034pub struct GPS2_RTK_DATA {
14035 #[doc = "Time since boot of last baseline message received."]
14036 pub time_last_baseline_ms: u32,
14037 #[doc = "GPS Time of Week of last baseline"]
14038 pub tow: u32,
14039 #[doc = "Current baseline in ECEF x or NED north component."]
14040 pub baseline_a_mm: i32,
14041 #[doc = "Current baseline in ECEF y or NED east component."]
14042 pub baseline_b_mm: i32,
14043 #[doc = "Current baseline in ECEF z or NED down component."]
14044 pub baseline_c_mm: i32,
14045 #[doc = "Current estimate of baseline accuracy."]
14046 pub accuracy: u32,
14047 #[doc = "Current number of integer ambiguity hypotheses."]
14048 pub iar_num_hypotheses: i32,
14049 #[doc = "GPS Week Number of last baseline"]
14050 pub wn: u16,
14051 #[doc = "Identification of connected RTK receiver."]
14052 pub rtk_receiver_id: u8,
14053 #[doc = "GPS-specific health report for RTK data."]
14054 pub rtk_health: u8,
14055 #[doc = "Rate of baseline messages being received by GPS"]
14056 pub rtk_rate: u8,
14057 #[doc = "Current number of sats used for RTK calculation."]
14058 pub nsats: u8,
14059 #[doc = "Coordinate system of baseline"]
14060 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14061}
14062impl GPS2_RTK_DATA {
14063 pub const ENCODED_LEN: usize = 35usize;
14064 pub const DEFAULT: Self = Self {
14065 time_last_baseline_ms: 0_u32,
14066 tow: 0_u32,
14067 baseline_a_mm: 0_i32,
14068 baseline_b_mm: 0_i32,
14069 baseline_c_mm: 0_i32,
14070 accuracy: 0_u32,
14071 iar_num_hypotheses: 0_i32,
14072 wn: 0_u16,
14073 rtk_receiver_id: 0_u8,
14074 rtk_health: 0_u8,
14075 rtk_rate: 0_u8,
14076 nsats: 0_u8,
14077 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14078 };
14079 #[cfg(feature = "arbitrary")]
14080 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14081 use arbitrary::{Arbitrary, Unstructured};
14082 let mut buf = [0u8; 1024];
14083 rng.fill_bytes(&mut buf);
14084 let mut unstructured = Unstructured::new(&buf);
14085 Self::arbitrary(&mut unstructured).unwrap_or_default()
14086 }
14087}
14088impl Default for GPS2_RTK_DATA {
14089 fn default() -> Self {
14090 Self::DEFAULT.clone()
14091 }
14092}
14093impl MessageData for GPS2_RTK_DATA {
14094 type Message = MavMessage;
14095 const ID: u32 = 128u32;
14096 const NAME: &'static str = "GPS2_RTK";
14097 const EXTRA_CRC: u8 = 226u8;
14098 const ENCODED_LEN: usize = 35usize;
14099 fn deser(
14100 _version: MavlinkVersion,
14101 __input: &[u8],
14102 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14103 let avail_len = __input.len();
14104 let mut payload_buf = [0; Self::ENCODED_LEN];
14105 let mut buf = if avail_len < Self::ENCODED_LEN {
14106 payload_buf[0..avail_len].copy_from_slice(__input);
14107 Bytes::new(&payload_buf)
14108 } else {
14109 Bytes::new(__input)
14110 };
14111 let mut __struct = Self::default();
14112 __struct.time_last_baseline_ms = buf.get_u32_le();
14113 __struct.tow = buf.get_u32_le();
14114 __struct.baseline_a_mm = buf.get_i32_le();
14115 __struct.baseline_b_mm = buf.get_i32_le();
14116 __struct.baseline_c_mm = buf.get_i32_le();
14117 __struct.accuracy = buf.get_u32_le();
14118 __struct.iar_num_hypotheses = buf.get_i32_le();
14119 __struct.wn = buf.get_u16_le();
14120 __struct.rtk_receiver_id = buf.get_u8();
14121 __struct.rtk_health = buf.get_u8();
14122 __struct.rtk_rate = buf.get_u8();
14123 __struct.nsats = buf.get_u8();
14124 let tmp = buf.get_u8();
14125 __struct.baseline_coords_type =
14126 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14127 enum_type: "RtkBaselineCoordinateSystem",
14128 value: tmp as u64,
14129 })?;
14130 Ok(__struct)
14131 }
14132 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14133 let mut __tmp = BytesMut::new(bytes);
14134 #[allow(clippy::absurd_extreme_comparisons)]
14135 #[allow(unused_comparisons)]
14136 if __tmp.remaining() < Self::ENCODED_LEN {
14137 panic!(
14138 "buffer is too small (need {} bytes, but got {})",
14139 Self::ENCODED_LEN,
14140 __tmp.remaining(),
14141 )
14142 }
14143 __tmp.put_u32_le(self.time_last_baseline_ms);
14144 __tmp.put_u32_le(self.tow);
14145 __tmp.put_i32_le(self.baseline_a_mm);
14146 __tmp.put_i32_le(self.baseline_b_mm);
14147 __tmp.put_i32_le(self.baseline_c_mm);
14148 __tmp.put_u32_le(self.accuracy);
14149 __tmp.put_i32_le(self.iar_num_hypotheses);
14150 __tmp.put_u16_le(self.wn);
14151 __tmp.put_u8(self.rtk_receiver_id);
14152 __tmp.put_u8(self.rtk_health);
14153 __tmp.put_u8(self.rtk_rate);
14154 __tmp.put_u8(self.nsats);
14155 __tmp.put_u8(self.baseline_coords_type as u8);
14156 if matches!(version, MavlinkVersion::V2) {
14157 let len = __tmp.len();
14158 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14159 } else {
14160 __tmp.len()
14161 }
14162 }
14163}
14164#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
14165#[doc = ""]
14166#[doc = "ID: 49"]
14167#[derive(Debug, Clone, PartialEq)]
14168#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14169#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14170#[cfg_attr(feature = "ts", derive(TS))]
14171#[cfg_attr(feature = "ts", ts(export))]
14172pub struct GPS_GLOBAL_ORIGIN_DATA {
14173 #[doc = "Latitude (WGS84)"]
14174 pub latitude: i32,
14175 #[doc = "Longitude (WGS84)"]
14176 pub longitude: i32,
14177 #[doc = "Altitude (MSL). Positive for up."]
14178 pub altitude: i32,
14179 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14180 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14181 pub time_usec: u64,
14182}
14183impl GPS_GLOBAL_ORIGIN_DATA {
14184 pub const ENCODED_LEN: usize = 20usize;
14185 pub const DEFAULT: Self = Self {
14186 latitude: 0_i32,
14187 longitude: 0_i32,
14188 altitude: 0_i32,
14189 time_usec: 0_u64,
14190 };
14191 #[cfg(feature = "arbitrary")]
14192 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14193 use arbitrary::{Arbitrary, Unstructured};
14194 let mut buf = [0u8; 1024];
14195 rng.fill_bytes(&mut buf);
14196 let mut unstructured = Unstructured::new(&buf);
14197 Self::arbitrary(&mut unstructured).unwrap_or_default()
14198 }
14199}
14200impl Default for GPS_GLOBAL_ORIGIN_DATA {
14201 fn default() -> Self {
14202 Self::DEFAULT.clone()
14203 }
14204}
14205impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
14206 type Message = MavMessage;
14207 const ID: u32 = 49u32;
14208 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
14209 const EXTRA_CRC: u8 = 39u8;
14210 const ENCODED_LEN: usize = 20usize;
14211 fn deser(
14212 _version: MavlinkVersion,
14213 __input: &[u8],
14214 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14215 let avail_len = __input.len();
14216 let mut payload_buf = [0; Self::ENCODED_LEN];
14217 let mut buf = if avail_len < Self::ENCODED_LEN {
14218 payload_buf[0..avail_len].copy_from_slice(__input);
14219 Bytes::new(&payload_buf)
14220 } else {
14221 Bytes::new(__input)
14222 };
14223 let mut __struct = Self::default();
14224 __struct.latitude = buf.get_i32_le();
14225 __struct.longitude = buf.get_i32_le();
14226 __struct.altitude = buf.get_i32_le();
14227 __struct.time_usec = buf.get_u64_le();
14228 Ok(__struct)
14229 }
14230 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14231 let mut __tmp = BytesMut::new(bytes);
14232 #[allow(clippy::absurd_extreme_comparisons)]
14233 #[allow(unused_comparisons)]
14234 if __tmp.remaining() < Self::ENCODED_LEN {
14235 panic!(
14236 "buffer is too small (need {} bytes, but got {})",
14237 Self::ENCODED_LEN,
14238 __tmp.remaining(),
14239 )
14240 }
14241 __tmp.put_i32_le(self.latitude);
14242 __tmp.put_i32_le(self.longitude);
14243 __tmp.put_i32_le(self.altitude);
14244 if matches!(version, MavlinkVersion::V2) {
14245 __tmp.put_u64_le(self.time_usec);
14246 let len = __tmp.len();
14247 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14248 } else {
14249 __tmp.len()
14250 }
14251 }
14252}
14253#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
14254#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
14255#[doc = ""]
14256#[doc = "ID: 123"]
14257#[derive(Debug, Clone, PartialEq)]
14258#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14259#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14260#[cfg_attr(feature = "ts", derive(TS))]
14261#[cfg_attr(feature = "ts", ts(export))]
14262pub struct GPS_INJECT_DATA_DATA {
14263 #[doc = "System ID"]
14264 pub target_system: u8,
14265 #[doc = "Component ID"]
14266 pub target_component: u8,
14267 #[doc = "Data length"]
14268 pub len: u8,
14269 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
14270 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14271 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14272 pub data: [u8; 110],
14273}
14274impl GPS_INJECT_DATA_DATA {
14275 pub const ENCODED_LEN: usize = 113usize;
14276 pub const DEFAULT: Self = Self {
14277 target_system: 0_u8,
14278 target_component: 0_u8,
14279 len: 0_u8,
14280 data: [0_u8; 110usize],
14281 };
14282 #[cfg(feature = "arbitrary")]
14283 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14284 use arbitrary::{Arbitrary, Unstructured};
14285 let mut buf = [0u8; 1024];
14286 rng.fill_bytes(&mut buf);
14287 let mut unstructured = Unstructured::new(&buf);
14288 Self::arbitrary(&mut unstructured).unwrap_or_default()
14289 }
14290}
14291impl Default for GPS_INJECT_DATA_DATA {
14292 fn default() -> Self {
14293 Self::DEFAULT.clone()
14294 }
14295}
14296impl MessageData for GPS_INJECT_DATA_DATA {
14297 type Message = MavMessage;
14298 const ID: u32 = 123u32;
14299 const NAME: &'static str = "GPS_INJECT_DATA";
14300 const EXTRA_CRC: u8 = 250u8;
14301 const ENCODED_LEN: usize = 113usize;
14302 fn deser(
14303 _version: MavlinkVersion,
14304 __input: &[u8],
14305 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14306 let avail_len = __input.len();
14307 let mut payload_buf = [0; Self::ENCODED_LEN];
14308 let mut buf = if avail_len < Self::ENCODED_LEN {
14309 payload_buf[0..avail_len].copy_from_slice(__input);
14310 Bytes::new(&payload_buf)
14311 } else {
14312 Bytes::new(__input)
14313 };
14314 let mut __struct = Self::default();
14315 __struct.target_system = buf.get_u8();
14316 __struct.target_component = buf.get_u8();
14317 __struct.len = buf.get_u8();
14318 for v in &mut __struct.data {
14319 let val = buf.get_u8();
14320 *v = val;
14321 }
14322 Ok(__struct)
14323 }
14324 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14325 let mut __tmp = BytesMut::new(bytes);
14326 #[allow(clippy::absurd_extreme_comparisons)]
14327 #[allow(unused_comparisons)]
14328 if __tmp.remaining() < Self::ENCODED_LEN {
14329 panic!(
14330 "buffer is too small (need {} bytes, but got {})",
14331 Self::ENCODED_LEN,
14332 __tmp.remaining(),
14333 )
14334 }
14335 __tmp.put_u8(self.target_system);
14336 __tmp.put_u8(self.target_component);
14337 __tmp.put_u8(self.len);
14338 for val in &self.data {
14339 __tmp.put_u8(*val);
14340 }
14341 if matches!(version, MavlinkVersion::V2) {
14342 let len = __tmp.len();
14343 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14344 } else {
14345 __tmp.len()
14346 }
14347 }
14348}
14349#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
14350#[doc = ""]
14351#[doc = "ID: 232"]
14352#[derive(Debug, Clone, PartialEq)]
14353#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14354#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14355#[cfg_attr(feature = "ts", derive(TS))]
14356#[cfg_attr(feature = "ts", ts(export))]
14357pub struct GPS_INPUT_DATA {
14358 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14359 pub time_usec: u64,
14360 #[doc = "GPS time (from start of GPS week)"]
14361 pub time_week_ms: u32,
14362 #[doc = "Latitude (WGS84)"]
14363 pub lat: i32,
14364 #[doc = "Longitude (WGS84)"]
14365 pub lon: i32,
14366 #[doc = "Altitude (MSL). Positive for up."]
14367 pub alt: f32,
14368 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14369 pub hdop: f32,
14370 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14371 pub vdop: f32,
14372 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
14373 pub vn: f32,
14374 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
14375 pub ve: f32,
14376 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
14377 pub vd: f32,
14378 #[doc = "GPS speed accuracy"]
14379 pub speed_accuracy: f32,
14380 #[doc = "GPS horizontal accuracy"]
14381 pub horiz_accuracy: f32,
14382 #[doc = "GPS vertical accuracy"]
14383 pub vert_accuracy: f32,
14384 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
14385 pub ignore_flags: GpsInputIgnoreFlags,
14386 #[doc = "GPS week number"]
14387 pub time_week: u16,
14388 #[doc = "ID of the GPS for multiple GPS inputs"]
14389 pub gps_id: u8,
14390 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
14391 pub fix_type: u8,
14392 #[doc = "Number of satellites visible."]
14393 pub satellites_visible: u8,
14394 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
14395 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14396 pub yaw: u16,
14397}
14398impl GPS_INPUT_DATA {
14399 pub const ENCODED_LEN: usize = 65usize;
14400 pub const DEFAULT: Self = Self {
14401 time_usec: 0_u64,
14402 time_week_ms: 0_u32,
14403 lat: 0_i32,
14404 lon: 0_i32,
14405 alt: 0.0_f32,
14406 hdop: 0.0_f32,
14407 vdop: 0.0_f32,
14408 vn: 0.0_f32,
14409 ve: 0.0_f32,
14410 vd: 0.0_f32,
14411 speed_accuracy: 0.0_f32,
14412 horiz_accuracy: 0.0_f32,
14413 vert_accuracy: 0.0_f32,
14414 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
14415 time_week: 0_u16,
14416 gps_id: 0_u8,
14417 fix_type: 0_u8,
14418 satellites_visible: 0_u8,
14419 yaw: 0_u16,
14420 };
14421 #[cfg(feature = "arbitrary")]
14422 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14423 use arbitrary::{Arbitrary, Unstructured};
14424 let mut buf = [0u8; 1024];
14425 rng.fill_bytes(&mut buf);
14426 let mut unstructured = Unstructured::new(&buf);
14427 Self::arbitrary(&mut unstructured).unwrap_or_default()
14428 }
14429}
14430impl Default for GPS_INPUT_DATA {
14431 fn default() -> Self {
14432 Self::DEFAULT.clone()
14433 }
14434}
14435impl MessageData for GPS_INPUT_DATA {
14436 type Message = MavMessage;
14437 const ID: u32 = 232u32;
14438 const NAME: &'static str = "GPS_INPUT";
14439 const EXTRA_CRC: u8 = 151u8;
14440 const ENCODED_LEN: usize = 65usize;
14441 fn deser(
14442 _version: MavlinkVersion,
14443 __input: &[u8],
14444 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14445 let avail_len = __input.len();
14446 let mut payload_buf = [0; Self::ENCODED_LEN];
14447 let mut buf = if avail_len < Self::ENCODED_LEN {
14448 payload_buf[0..avail_len].copy_from_slice(__input);
14449 Bytes::new(&payload_buf)
14450 } else {
14451 Bytes::new(__input)
14452 };
14453 let mut __struct = Self::default();
14454 __struct.time_usec = buf.get_u64_le();
14455 __struct.time_week_ms = buf.get_u32_le();
14456 __struct.lat = buf.get_i32_le();
14457 __struct.lon = buf.get_i32_le();
14458 __struct.alt = buf.get_f32_le();
14459 __struct.hdop = buf.get_f32_le();
14460 __struct.vdop = buf.get_f32_le();
14461 __struct.vn = buf.get_f32_le();
14462 __struct.ve = buf.get_f32_le();
14463 __struct.vd = buf.get_f32_le();
14464 __struct.speed_accuracy = buf.get_f32_le();
14465 __struct.horiz_accuracy = buf.get_f32_le();
14466 __struct.vert_accuracy = buf.get_f32_le();
14467 let tmp = buf.get_u16_le();
14468 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
14469 tmp as <GpsInputIgnoreFlags as Flags>::Bits,
14470 )
14471 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14472 flag_type: "GpsInputIgnoreFlags",
14473 value: tmp as u64,
14474 })?;
14475 __struct.time_week = buf.get_u16_le();
14476 __struct.gps_id = buf.get_u8();
14477 __struct.fix_type = buf.get_u8();
14478 __struct.satellites_visible = buf.get_u8();
14479 __struct.yaw = buf.get_u16_le();
14480 Ok(__struct)
14481 }
14482 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14483 let mut __tmp = BytesMut::new(bytes);
14484 #[allow(clippy::absurd_extreme_comparisons)]
14485 #[allow(unused_comparisons)]
14486 if __tmp.remaining() < Self::ENCODED_LEN {
14487 panic!(
14488 "buffer is too small (need {} bytes, but got {})",
14489 Self::ENCODED_LEN,
14490 __tmp.remaining(),
14491 )
14492 }
14493 __tmp.put_u64_le(self.time_usec);
14494 __tmp.put_u32_le(self.time_week_ms);
14495 __tmp.put_i32_le(self.lat);
14496 __tmp.put_i32_le(self.lon);
14497 __tmp.put_f32_le(self.alt);
14498 __tmp.put_f32_le(self.hdop);
14499 __tmp.put_f32_le(self.vdop);
14500 __tmp.put_f32_le(self.vn);
14501 __tmp.put_f32_le(self.ve);
14502 __tmp.put_f32_le(self.vd);
14503 __tmp.put_f32_le(self.speed_accuracy);
14504 __tmp.put_f32_le(self.horiz_accuracy);
14505 __tmp.put_f32_le(self.vert_accuracy);
14506 __tmp.put_u16_le(self.ignore_flags.bits() as u16);
14507 __tmp.put_u16_le(self.time_week);
14508 __tmp.put_u8(self.gps_id);
14509 __tmp.put_u8(self.fix_type);
14510 __tmp.put_u8(self.satellites_visible);
14511 if matches!(version, MavlinkVersion::V2) {
14512 __tmp.put_u16_le(self.yaw);
14513 let len = __tmp.len();
14514 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14515 } else {
14516 __tmp.len()
14517 }
14518 }
14519}
14520#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
14521#[doc = ""]
14522#[doc = "ID: 24"]
14523#[derive(Debug, Clone, PartialEq)]
14524#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14525#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14526#[cfg_attr(feature = "ts", derive(TS))]
14527#[cfg_attr(feature = "ts", ts(export))]
14528pub struct GPS_RAW_INT_DATA {
14529 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14530 pub time_usec: u64,
14531 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
14532 pub lat: i32,
14533 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
14534 pub lon: i32,
14535 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
14536 pub alt: i32,
14537 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14538 pub eph: u16,
14539 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14540 pub epv: u16,
14541 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14542 pub vel: u16,
14543 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14544 pub cog: u16,
14545 #[doc = "GPS fix type."]
14546 pub fix_type: GpsFixType,
14547 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14548 pub satellites_visible: u8,
14549 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14550 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14551 pub alt_ellipsoid: i32,
14552 #[doc = "Position uncertainty."]
14553 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14554 pub h_acc: u32,
14555 #[doc = "Altitude uncertainty."]
14556 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14557 pub v_acc: u32,
14558 #[doc = "Speed uncertainty."]
14559 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14560 pub vel_acc: u32,
14561 #[doc = "Heading / track uncertainty"]
14562 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14563 pub hdg_acc: u32,
14564 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14565 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14566 pub yaw: u16,
14567}
14568impl GPS_RAW_INT_DATA {
14569 pub const ENCODED_LEN: usize = 52usize;
14570 pub const DEFAULT: Self = Self {
14571 time_usec: 0_u64,
14572 lat: 0_i32,
14573 lon: 0_i32,
14574 alt: 0_i32,
14575 eph: 0_u16,
14576 epv: 0_u16,
14577 vel: 0_u16,
14578 cog: 0_u16,
14579 fix_type: GpsFixType::DEFAULT,
14580 satellites_visible: 0_u8,
14581 alt_ellipsoid: 0_i32,
14582 h_acc: 0_u32,
14583 v_acc: 0_u32,
14584 vel_acc: 0_u32,
14585 hdg_acc: 0_u32,
14586 yaw: 0_u16,
14587 };
14588 #[cfg(feature = "arbitrary")]
14589 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14590 use arbitrary::{Arbitrary, Unstructured};
14591 let mut buf = [0u8; 1024];
14592 rng.fill_bytes(&mut buf);
14593 let mut unstructured = Unstructured::new(&buf);
14594 Self::arbitrary(&mut unstructured).unwrap_or_default()
14595 }
14596}
14597impl Default for GPS_RAW_INT_DATA {
14598 fn default() -> Self {
14599 Self::DEFAULT.clone()
14600 }
14601}
14602impl MessageData for GPS_RAW_INT_DATA {
14603 type Message = MavMessage;
14604 const ID: u32 = 24u32;
14605 const NAME: &'static str = "GPS_RAW_INT";
14606 const EXTRA_CRC: u8 = 24u8;
14607 const ENCODED_LEN: usize = 52usize;
14608 fn deser(
14609 _version: MavlinkVersion,
14610 __input: &[u8],
14611 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14612 let avail_len = __input.len();
14613 let mut payload_buf = [0; Self::ENCODED_LEN];
14614 let mut buf = if avail_len < Self::ENCODED_LEN {
14615 payload_buf[0..avail_len].copy_from_slice(__input);
14616 Bytes::new(&payload_buf)
14617 } else {
14618 Bytes::new(__input)
14619 };
14620 let mut __struct = Self::default();
14621 __struct.time_usec = buf.get_u64_le();
14622 __struct.lat = buf.get_i32_le();
14623 __struct.lon = buf.get_i32_le();
14624 __struct.alt = buf.get_i32_le();
14625 __struct.eph = buf.get_u16_le();
14626 __struct.epv = buf.get_u16_le();
14627 __struct.vel = buf.get_u16_le();
14628 __struct.cog = buf.get_u16_le();
14629 let tmp = buf.get_u8();
14630 __struct.fix_type =
14631 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14632 enum_type: "GpsFixType",
14633 value: tmp as u64,
14634 })?;
14635 __struct.satellites_visible = buf.get_u8();
14636 __struct.alt_ellipsoid = buf.get_i32_le();
14637 __struct.h_acc = buf.get_u32_le();
14638 __struct.v_acc = buf.get_u32_le();
14639 __struct.vel_acc = buf.get_u32_le();
14640 __struct.hdg_acc = buf.get_u32_le();
14641 __struct.yaw = buf.get_u16_le();
14642 Ok(__struct)
14643 }
14644 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14645 let mut __tmp = BytesMut::new(bytes);
14646 #[allow(clippy::absurd_extreme_comparisons)]
14647 #[allow(unused_comparisons)]
14648 if __tmp.remaining() < Self::ENCODED_LEN {
14649 panic!(
14650 "buffer is too small (need {} bytes, but got {})",
14651 Self::ENCODED_LEN,
14652 __tmp.remaining(),
14653 )
14654 }
14655 __tmp.put_u64_le(self.time_usec);
14656 __tmp.put_i32_le(self.lat);
14657 __tmp.put_i32_le(self.lon);
14658 __tmp.put_i32_le(self.alt);
14659 __tmp.put_u16_le(self.eph);
14660 __tmp.put_u16_le(self.epv);
14661 __tmp.put_u16_le(self.vel);
14662 __tmp.put_u16_le(self.cog);
14663 __tmp.put_u8(self.fix_type as u8);
14664 __tmp.put_u8(self.satellites_visible);
14665 if matches!(version, MavlinkVersion::V2) {
14666 __tmp.put_i32_le(self.alt_ellipsoid);
14667 __tmp.put_u32_le(self.h_acc);
14668 __tmp.put_u32_le(self.v_acc);
14669 __tmp.put_u32_le(self.vel_acc);
14670 __tmp.put_u32_le(self.hdg_acc);
14671 __tmp.put_u16_le(self.yaw);
14672 let len = __tmp.len();
14673 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14674 } else {
14675 __tmp.len()
14676 }
14677 }
14678}
14679#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
14680#[doc = ""]
14681#[doc = "ID: 233"]
14682#[derive(Debug, Clone, PartialEq)]
14683#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14684#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14685#[cfg_attr(feature = "ts", derive(TS))]
14686#[cfg_attr(feature = "ts", ts(export))]
14687pub struct GPS_RTCM_DATA_DATA {
14688 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
14689 pub flags: u8,
14690 #[doc = "data length"]
14691 pub len: u8,
14692 #[doc = "RTCM message (may be fragmented)"]
14693 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14694 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14695 pub data: [u8; 180],
14696}
14697impl GPS_RTCM_DATA_DATA {
14698 pub const ENCODED_LEN: usize = 182usize;
14699 pub const DEFAULT: Self = Self {
14700 flags: 0_u8,
14701 len: 0_u8,
14702 data: [0_u8; 180usize],
14703 };
14704 #[cfg(feature = "arbitrary")]
14705 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14706 use arbitrary::{Arbitrary, Unstructured};
14707 let mut buf = [0u8; 1024];
14708 rng.fill_bytes(&mut buf);
14709 let mut unstructured = Unstructured::new(&buf);
14710 Self::arbitrary(&mut unstructured).unwrap_or_default()
14711 }
14712}
14713impl Default for GPS_RTCM_DATA_DATA {
14714 fn default() -> Self {
14715 Self::DEFAULT.clone()
14716 }
14717}
14718impl MessageData for GPS_RTCM_DATA_DATA {
14719 type Message = MavMessage;
14720 const ID: u32 = 233u32;
14721 const NAME: &'static str = "GPS_RTCM_DATA";
14722 const EXTRA_CRC: u8 = 35u8;
14723 const ENCODED_LEN: usize = 182usize;
14724 fn deser(
14725 _version: MavlinkVersion,
14726 __input: &[u8],
14727 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14728 let avail_len = __input.len();
14729 let mut payload_buf = [0; Self::ENCODED_LEN];
14730 let mut buf = if avail_len < Self::ENCODED_LEN {
14731 payload_buf[0..avail_len].copy_from_slice(__input);
14732 Bytes::new(&payload_buf)
14733 } else {
14734 Bytes::new(__input)
14735 };
14736 let mut __struct = Self::default();
14737 __struct.flags = buf.get_u8();
14738 __struct.len = buf.get_u8();
14739 for v in &mut __struct.data {
14740 let val = buf.get_u8();
14741 *v = val;
14742 }
14743 Ok(__struct)
14744 }
14745 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14746 let mut __tmp = BytesMut::new(bytes);
14747 #[allow(clippy::absurd_extreme_comparisons)]
14748 #[allow(unused_comparisons)]
14749 if __tmp.remaining() < Self::ENCODED_LEN {
14750 panic!(
14751 "buffer is too small (need {} bytes, but got {})",
14752 Self::ENCODED_LEN,
14753 __tmp.remaining(),
14754 )
14755 }
14756 __tmp.put_u8(self.flags);
14757 __tmp.put_u8(self.len);
14758 for val in &self.data {
14759 __tmp.put_u8(*val);
14760 }
14761 if matches!(version, MavlinkVersion::V2) {
14762 let len = __tmp.len();
14763 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14764 } else {
14765 __tmp.len()
14766 }
14767 }
14768}
14769#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14770#[doc = ""]
14771#[doc = "ID: 127"]
14772#[derive(Debug, Clone, PartialEq)]
14773#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14774#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14775#[cfg_attr(feature = "ts", derive(TS))]
14776#[cfg_attr(feature = "ts", ts(export))]
14777pub struct GPS_RTK_DATA {
14778 #[doc = "Time since boot of last baseline message received."]
14779 pub time_last_baseline_ms: u32,
14780 #[doc = "GPS Time of Week of last baseline"]
14781 pub tow: u32,
14782 #[doc = "Current baseline in ECEF x or NED north component."]
14783 pub baseline_a_mm: i32,
14784 #[doc = "Current baseline in ECEF y or NED east component."]
14785 pub baseline_b_mm: i32,
14786 #[doc = "Current baseline in ECEF z or NED down component."]
14787 pub baseline_c_mm: i32,
14788 #[doc = "Current estimate of baseline accuracy."]
14789 pub accuracy: u32,
14790 #[doc = "Current number of integer ambiguity hypotheses."]
14791 pub iar_num_hypotheses: i32,
14792 #[doc = "GPS Week Number of last baseline"]
14793 pub wn: u16,
14794 #[doc = "Identification of connected RTK receiver."]
14795 pub rtk_receiver_id: u8,
14796 #[doc = "GPS-specific health report for RTK data."]
14797 pub rtk_health: u8,
14798 #[doc = "Rate of baseline messages being received by GPS"]
14799 pub rtk_rate: u8,
14800 #[doc = "Current number of sats used for RTK calculation."]
14801 pub nsats: u8,
14802 #[doc = "Coordinate system of baseline"]
14803 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14804}
14805impl GPS_RTK_DATA {
14806 pub const ENCODED_LEN: usize = 35usize;
14807 pub const DEFAULT: Self = Self {
14808 time_last_baseline_ms: 0_u32,
14809 tow: 0_u32,
14810 baseline_a_mm: 0_i32,
14811 baseline_b_mm: 0_i32,
14812 baseline_c_mm: 0_i32,
14813 accuracy: 0_u32,
14814 iar_num_hypotheses: 0_i32,
14815 wn: 0_u16,
14816 rtk_receiver_id: 0_u8,
14817 rtk_health: 0_u8,
14818 rtk_rate: 0_u8,
14819 nsats: 0_u8,
14820 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14821 };
14822 #[cfg(feature = "arbitrary")]
14823 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14824 use arbitrary::{Arbitrary, Unstructured};
14825 let mut buf = [0u8; 1024];
14826 rng.fill_bytes(&mut buf);
14827 let mut unstructured = Unstructured::new(&buf);
14828 Self::arbitrary(&mut unstructured).unwrap_or_default()
14829 }
14830}
14831impl Default for GPS_RTK_DATA {
14832 fn default() -> Self {
14833 Self::DEFAULT.clone()
14834 }
14835}
14836impl MessageData for GPS_RTK_DATA {
14837 type Message = MavMessage;
14838 const ID: u32 = 127u32;
14839 const NAME: &'static str = "GPS_RTK";
14840 const EXTRA_CRC: u8 = 25u8;
14841 const ENCODED_LEN: usize = 35usize;
14842 fn deser(
14843 _version: MavlinkVersion,
14844 __input: &[u8],
14845 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14846 let avail_len = __input.len();
14847 let mut payload_buf = [0; Self::ENCODED_LEN];
14848 let mut buf = if avail_len < Self::ENCODED_LEN {
14849 payload_buf[0..avail_len].copy_from_slice(__input);
14850 Bytes::new(&payload_buf)
14851 } else {
14852 Bytes::new(__input)
14853 };
14854 let mut __struct = Self::default();
14855 __struct.time_last_baseline_ms = buf.get_u32_le();
14856 __struct.tow = buf.get_u32_le();
14857 __struct.baseline_a_mm = buf.get_i32_le();
14858 __struct.baseline_b_mm = buf.get_i32_le();
14859 __struct.baseline_c_mm = buf.get_i32_le();
14860 __struct.accuracy = buf.get_u32_le();
14861 __struct.iar_num_hypotheses = buf.get_i32_le();
14862 __struct.wn = buf.get_u16_le();
14863 __struct.rtk_receiver_id = buf.get_u8();
14864 __struct.rtk_health = buf.get_u8();
14865 __struct.rtk_rate = buf.get_u8();
14866 __struct.nsats = buf.get_u8();
14867 let tmp = buf.get_u8();
14868 __struct.baseline_coords_type =
14869 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14870 enum_type: "RtkBaselineCoordinateSystem",
14871 value: tmp as u64,
14872 })?;
14873 Ok(__struct)
14874 }
14875 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14876 let mut __tmp = BytesMut::new(bytes);
14877 #[allow(clippy::absurd_extreme_comparisons)]
14878 #[allow(unused_comparisons)]
14879 if __tmp.remaining() < Self::ENCODED_LEN {
14880 panic!(
14881 "buffer is too small (need {} bytes, but got {})",
14882 Self::ENCODED_LEN,
14883 __tmp.remaining(),
14884 )
14885 }
14886 __tmp.put_u32_le(self.time_last_baseline_ms);
14887 __tmp.put_u32_le(self.tow);
14888 __tmp.put_i32_le(self.baseline_a_mm);
14889 __tmp.put_i32_le(self.baseline_b_mm);
14890 __tmp.put_i32_le(self.baseline_c_mm);
14891 __tmp.put_u32_le(self.accuracy);
14892 __tmp.put_i32_le(self.iar_num_hypotheses);
14893 __tmp.put_u16_le(self.wn);
14894 __tmp.put_u8(self.rtk_receiver_id);
14895 __tmp.put_u8(self.rtk_health);
14896 __tmp.put_u8(self.rtk_rate);
14897 __tmp.put_u8(self.nsats);
14898 __tmp.put_u8(self.baseline_coords_type as u8);
14899 if matches!(version, MavlinkVersion::V2) {
14900 let len = __tmp.len();
14901 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14902 } else {
14903 __tmp.len()
14904 }
14905 }
14906}
14907#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
14908#[doc = ""]
14909#[doc = "ID: 25"]
14910#[derive(Debug, Clone, PartialEq)]
14911#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14912#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14913#[cfg_attr(feature = "ts", derive(TS))]
14914#[cfg_attr(feature = "ts", ts(export))]
14915pub struct GPS_STATUS_DATA {
14916 #[doc = "Number of satellites visible"]
14917 pub satellites_visible: u8,
14918 #[doc = "Global satellite ID"]
14919 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14920 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14921 pub satellite_prn: [u8; 20],
14922 #[doc = "0: Satellite not used, 1: used for localization"]
14923 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14924 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14925 pub satellite_used: [u8; 20],
14926 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
14927 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14928 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14929 pub satellite_elevation: [u8; 20],
14930 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
14931 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14932 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14933 pub satellite_azimuth: [u8; 20],
14934 #[doc = "Signal to noise ratio of satellite"]
14935 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14936 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14937 pub satellite_snr: [u8; 20],
14938}
14939impl GPS_STATUS_DATA {
14940 pub const ENCODED_LEN: usize = 101usize;
14941 pub const DEFAULT: Self = Self {
14942 satellites_visible: 0_u8,
14943 satellite_prn: [0_u8; 20usize],
14944 satellite_used: [0_u8; 20usize],
14945 satellite_elevation: [0_u8; 20usize],
14946 satellite_azimuth: [0_u8; 20usize],
14947 satellite_snr: [0_u8; 20usize],
14948 };
14949 #[cfg(feature = "arbitrary")]
14950 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14951 use arbitrary::{Arbitrary, Unstructured};
14952 let mut buf = [0u8; 1024];
14953 rng.fill_bytes(&mut buf);
14954 let mut unstructured = Unstructured::new(&buf);
14955 Self::arbitrary(&mut unstructured).unwrap_or_default()
14956 }
14957}
14958impl Default for GPS_STATUS_DATA {
14959 fn default() -> Self {
14960 Self::DEFAULT.clone()
14961 }
14962}
14963impl MessageData for GPS_STATUS_DATA {
14964 type Message = MavMessage;
14965 const ID: u32 = 25u32;
14966 const NAME: &'static str = "GPS_STATUS";
14967 const EXTRA_CRC: u8 = 23u8;
14968 const ENCODED_LEN: usize = 101usize;
14969 fn deser(
14970 _version: MavlinkVersion,
14971 __input: &[u8],
14972 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14973 let avail_len = __input.len();
14974 let mut payload_buf = [0; Self::ENCODED_LEN];
14975 let mut buf = if avail_len < Self::ENCODED_LEN {
14976 payload_buf[0..avail_len].copy_from_slice(__input);
14977 Bytes::new(&payload_buf)
14978 } else {
14979 Bytes::new(__input)
14980 };
14981 let mut __struct = Self::default();
14982 __struct.satellites_visible = buf.get_u8();
14983 for v in &mut __struct.satellite_prn {
14984 let val = buf.get_u8();
14985 *v = val;
14986 }
14987 for v in &mut __struct.satellite_used {
14988 let val = buf.get_u8();
14989 *v = val;
14990 }
14991 for v in &mut __struct.satellite_elevation {
14992 let val = buf.get_u8();
14993 *v = val;
14994 }
14995 for v in &mut __struct.satellite_azimuth {
14996 let val = buf.get_u8();
14997 *v = val;
14998 }
14999 for v in &mut __struct.satellite_snr {
15000 let val = buf.get_u8();
15001 *v = val;
15002 }
15003 Ok(__struct)
15004 }
15005 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15006 let mut __tmp = BytesMut::new(bytes);
15007 #[allow(clippy::absurd_extreme_comparisons)]
15008 #[allow(unused_comparisons)]
15009 if __tmp.remaining() < Self::ENCODED_LEN {
15010 panic!(
15011 "buffer is too small (need {} bytes, but got {})",
15012 Self::ENCODED_LEN,
15013 __tmp.remaining(),
15014 )
15015 }
15016 __tmp.put_u8(self.satellites_visible);
15017 for val in &self.satellite_prn {
15018 __tmp.put_u8(*val);
15019 }
15020 for val in &self.satellite_used {
15021 __tmp.put_u8(*val);
15022 }
15023 for val in &self.satellite_elevation {
15024 __tmp.put_u8(*val);
15025 }
15026 for val in &self.satellite_azimuth {
15027 __tmp.put_u8(*val);
15028 }
15029 for val in &self.satellite_snr {
15030 __tmp.put_u8(*val);
15031 }
15032 if matches!(version, MavlinkVersion::V2) {
15033 let len = __tmp.len();
15034 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15035 } else {
15036 __tmp.len()
15037 }
15038 }
15039}
15040#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
15041#[doc = ""]
15042#[doc = "ID: 0"]
15043#[derive(Debug, Clone, PartialEq)]
15044#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15045#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15046#[cfg_attr(feature = "ts", derive(TS))]
15047#[cfg_attr(feature = "ts", ts(export))]
15048pub struct HEARTBEAT_DATA {
15049 #[doc = "A bitfield for use for autopilot-specific flags"]
15050 pub custom_mode: u32,
15051 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
15052 pub mavtype: MavType,
15053 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15054 pub autopilot: MavAutopilot,
15055 #[doc = "System mode bitmap."]
15056 pub base_mode: MavModeFlag,
15057 #[doc = "System status flag."]
15058 pub system_status: MavState,
15059 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
15060 pub mavlink_version: u8,
15061}
15062impl HEARTBEAT_DATA {
15063 pub const ENCODED_LEN: usize = 9usize;
15064 pub const DEFAULT: Self = Self {
15065 custom_mode: 0_u32,
15066 mavtype: MavType::DEFAULT,
15067 autopilot: MavAutopilot::DEFAULT,
15068 base_mode: MavModeFlag::DEFAULT,
15069 system_status: MavState::DEFAULT,
15070 mavlink_version: MINOR_MAVLINK_VERSION,
15071 };
15072 #[cfg(feature = "arbitrary")]
15073 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15074 use arbitrary::{Arbitrary, Unstructured};
15075 let mut buf = [0u8; 1024];
15076 rng.fill_bytes(&mut buf);
15077 let mut unstructured = Unstructured::new(&buf);
15078 Self::arbitrary(&mut unstructured).unwrap_or_default()
15079 }
15080}
15081impl Default for HEARTBEAT_DATA {
15082 fn default() -> Self {
15083 Self::DEFAULT.clone()
15084 }
15085}
15086impl MessageData for HEARTBEAT_DATA {
15087 type Message = MavMessage;
15088 const ID: u32 = 0u32;
15089 const NAME: &'static str = "HEARTBEAT";
15090 const EXTRA_CRC: u8 = 50u8;
15091 const ENCODED_LEN: usize = 9usize;
15092 fn deser(
15093 _version: MavlinkVersion,
15094 __input: &[u8],
15095 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15096 let avail_len = __input.len();
15097 let mut payload_buf = [0; Self::ENCODED_LEN];
15098 let mut buf = if avail_len < Self::ENCODED_LEN {
15099 payload_buf[0..avail_len].copy_from_slice(__input);
15100 Bytes::new(&payload_buf)
15101 } else {
15102 Bytes::new(__input)
15103 };
15104 let mut __struct = Self::default();
15105 __struct.custom_mode = buf.get_u32_le();
15106 let tmp = buf.get_u8();
15107 __struct.mavtype =
15108 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15109 enum_type: "MavType",
15110 value: tmp as u64,
15111 })?;
15112 let tmp = buf.get_u8();
15113 __struct.autopilot =
15114 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15115 enum_type: "MavAutopilot",
15116 value: tmp as u64,
15117 })?;
15118 let tmp = buf.get_u8();
15119 __struct.base_mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
15120 ::mavlink_core::error::ParserError::InvalidFlag {
15121 flag_type: "MavModeFlag",
15122 value: tmp as u64,
15123 },
15124 )?;
15125 let tmp = buf.get_u8();
15126 __struct.system_status =
15127 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15128 enum_type: "MavState",
15129 value: tmp as u64,
15130 })?;
15131 __struct.mavlink_version = buf.get_u8();
15132 Ok(__struct)
15133 }
15134 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15135 let mut __tmp = BytesMut::new(bytes);
15136 #[allow(clippy::absurd_extreme_comparisons)]
15137 #[allow(unused_comparisons)]
15138 if __tmp.remaining() < Self::ENCODED_LEN {
15139 panic!(
15140 "buffer is too small (need {} bytes, but got {})",
15141 Self::ENCODED_LEN,
15142 __tmp.remaining(),
15143 )
15144 }
15145 __tmp.put_u32_le(self.custom_mode);
15146 __tmp.put_u8(self.mavtype as u8);
15147 __tmp.put_u8(self.autopilot as u8);
15148 __tmp.put_u8(self.base_mode.bits() as u8);
15149 __tmp.put_u8(self.system_status as u8);
15150 __tmp.put_u8(self.mavlink_version);
15151 if matches!(version, MavlinkVersion::V2) {
15152 let len = __tmp.len();
15153 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15154 } else {
15155 __tmp.len()
15156 }
15157 }
15158}
15159#[doc = "Herelink Telemetry."]
15160#[doc = ""]
15161#[doc = "ID: 50003"]
15162#[derive(Debug, Clone, PartialEq)]
15163#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15164#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15165#[cfg_attr(feature = "ts", derive(TS))]
15166#[cfg_attr(feature = "ts", ts(export))]
15167pub struct HERELINK_TELEM_DATA {
15168 pub rf_freq: u32,
15169 pub link_bw: u32,
15170 pub link_rate: u32,
15171 pub snr: i16,
15172 pub cpu_temp: i16,
15173 pub board_temp: i16,
15174 pub rssi: u8,
15175}
15176impl HERELINK_TELEM_DATA {
15177 pub const ENCODED_LEN: usize = 19usize;
15178 pub const DEFAULT: Self = Self {
15179 rf_freq: 0_u32,
15180 link_bw: 0_u32,
15181 link_rate: 0_u32,
15182 snr: 0_i16,
15183 cpu_temp: 0_i16,
15184 board_temp: 0_i16,
15185 rssi: 0_u8,
15186 };
15187 #[cfg(feature = "arbitrary")]
15188 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15189 use arbitrary::{Arbitrary, Unstructured};
15190 let mut buf = [0u8; 1024];
15191 rng.fill_bytes(&mut buf);
15192 let mut unstructured = Unstructured::new(&buf);
15193 Self::arbitrary(&mut unstructured).unwrap_or_default()
15194 }
15195}
15196impl Default for HERELINK_TELEM_DATA {
15197 fn default() -> Self {
15198 Self::DEFAULT.clone()
15199 }
15200}
15201impl MessageData for HERELINK_TELEM_DATA {
15202 type Message = MavMessage;
15203 const ID: u32 = 50003u32;
15204 const NAME: &'static str = "HERELINK_TELEM";
15205 const EXTRA_CRC: u8 = 62u8;
15206 const ENCODED_LEN: usize = 19usize;
15207 fn deser(
15208 _version: MavlinkVersion,
15209 __input: &[u8],
15210 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15211 let avail_len = __input.len();
15212 let mut payload_buf = [0; Self::ENCODED_LEN];
15213 let mut buf = if avail_len < Self::ENCODED_LEN {
15214 payload_buf[0..avail_len].copy_from_slice(__input);
15215 Bytes::new(&payload_buf)
15216 } else {
15217 Bytes::new(__input)
15218 };
15219 let mut __struct = Self::default();
15220 __struct.rf_freq = buf.get_u32_le();
15221 __struct.link_bw = buf.get_u32_le();
15222 __struct.link_rate = buf.get_u32_le();
15223 __struct.snr = buf.get_i16_le();
15224 __struct.cpu_temp = buf.get_i16_le();
15225 __struct.board_temp = buf.get_i16_le();
15226 __struct.rssi = buf.get_u8();
15227 Ok(__struct)
15228 }
15229 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15230 let mut __tmp = BytesMut::new(bytes);
15231 #[allow(clippy::absurd_extreme_comparisons)]
15232 #[allow(unused_comparisons)]
15233 if __tmp.remaining() < Self::ENCODED_LEN {
15234 panic!(
15235 "buffer is too small (need {} bytes, but got {})",
15236 Self::ENCODED_LEN,
15237 __tmp.remaining(),
15238 )
15239 }
15240 __tmp.put_u32_le(self.rf_freq);
15241 __tmp.put_u32_le(self.link_bw);
15242 __tmp.put_u32_le(self.link_rate);
15243 __tmp.put_i16_le(self.snr);
15244 __tmp.put_i16_le(self.cpu_temp);
15245 __tmp.put_i16_le(self.board_temp);
15246 __tmp.put_u8(self.rssi);
15247 if matches!(version, MavlinkVersion::V2) {
15248 let len = __tmp.len();
15249 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15250 } else {
15251 __tmp.len()
15252 }
15253 }
15254}
15255#[doc = "Information about video stream."]
15256#[doc = ""]
15257#[doc = "ID: 50002"]
15258#[derive(Debug, Clone, PartialEq)]
15259#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15260#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15261#[cfg_attr(feature = "ts", derive(TS))]
15262#[cfg_attr(feature = "ts", ts(export))]
15263pub struct HERELINK_VIDEO_STREAM_INFORMATION_DATA {
15264 #[doc = "Frame rate."]
15265 pub framerate: f32,
15266 #[doc = "Bit rate."]
15267 pub bitrate: u32,
15268 #[doc = "Horizontal resolution."]
15269 pub resolution_h: u16,
15270 #[doc = "Vertical resolution."]
15271 pub resolution_v: u16,
15272 #[doc = "Video image rotation clockwise."]
15273 pub rotation: u16,
15274 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
15275 pub camera_id: u8,
15276 #[doc = "Number of streams available."]
15277 pub status: u8,
15278 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
15279 #[cfg_attr(feature = "ts", ts(type = "string"))]
15280 pub uri: CharArray<230>,
15281}
15282impl HERELINK_VIDEO_STREAM_INFORMATION_DATA {
15283 pub const ENCODED_LEN: usize = 246usize;
15284 pub const DEFAULT: Self = Self {
15285 framerate: 0.0_f32,
15286 bitrate: 0_u32,
15287 resolution_h: 0_u16,
15288 resolution_v: 0_u16,
15289 rotation: 0_u16,
15290 camera_id: 0_u8,
15291 status: 0_u8,
15292 uri: CharArray::new([0_u8; 230usize]),
15293 };
15294 #[cfg(feature = "arbitrary")]
15295 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15296 use arbitrary::{Arbitrary, Unstructured};
15297 let mut buf = [0u8; 1024];
15298 rng.fill_bytes(&mut buf);
15299 let mut unstructured = Unstructured::new(&buf);
15300 Self::arbitrary(&mut unstructured).unwrap_or_default()
15301 }
15302}
15303impl Default for HERELINK_VIDEO_STREAM_INFORMATION_DATA {
15304 fn default() -> Self {
15305 Self::DEFAULT.clone()
15306 }
15307}
15308impl MessageData for HERELINK_VIDEO_STREAM_INFORMATION_DATA {
15309 type Message = MavMessage;
15310 const ID: u32 = 50002u32;
15311 const NAME: &'static str = "HERELINK_VIDEO_STREAM_INFORMATION";
15312 const EXTRA_CRC: u8 = 181u8;
15313 const ENCODED_LEN: usize = 246usize;
15314 fn deser(
15315 _version: MavlinkVersion,
15316 __input: &[u8],
15317 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15318 let avail_len = __input.len();
15319 let mut payload_buf = [0; Self::ENCODED_LEN];
15320 let mut buf = if avail_len < Self::ENCODED_LEN {
15321 payload_buf[0..avail_len].copy_from_slice(__input);
15322 Bytes::new(&payload_buf)
15323 } else {
15324 Bytes::new(__input)
15325 };
15326 let mut __struct = Self::default();
15327 __struct.framerate = buf.get_f32_le();
15328 __struct.bitrate = buf.get_u32_le();
15329 __struct.resolution_h = buf.get_u16_le();
15330 __struct.resolution_v = buf.get_u16_le();
15331 __struct.rotation = buf.get_u16_le();
15332 __struct.camera_id = buf.get_u8();
15333 __struct.status = buf.get_u8();
15334 let mut tmp = [0_u8; 230usize];
15335 for v in &mut tmp {
15336 *v = buf.get_u8();
15337 }
15338 __struct.uri = CharArray::new(tmp);
15339 Ok(__struct)
15340 }
15341 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15342 let mut __tmp = BytesMut::new(bytes);
15343 #[allow(clippy::absurd_extreme_comparisons)]
15344 #[allow(unused_comparisons)]
15345 if __tmp.remaining() < Self::ENCODED_LEN {
15346 panic!(
15347 "buffer is too small (need {} bytes, but got {})",
15348 Self::ENCODED_LEN,
15349 __tmp.remaining(),
15350 )
15351 }
15352 __tmp.put_f32_le(self.framerate);
15353 __tmp.put_u32_le(self.bitrate);
15354 __tmp.put_u16_le(self.resolution_h);
15355 __tmp.put_u16_le(self.resolution_v);
15356 __tmp.put_u16_le(self.rotation);
15357 __tmp.put_u8(self.camera_id);
15358 __tmp.put_u8(self.status);
15359 for val in &self.uri {
15360 __tmp.put_u8(*val);
15361 }
15362 if matches!(version, MavlinkVersion::V2) {
15363 let len = __tmp.len();
15364 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15365 } else {
15366 __tmp.len()
15367 }
15368 }
15369}
15370#[doc = "The IMU readings in SI units in NED body frame."]
15371#[doc = ""]
15372#[doc = "ID: 105"]
15373#[derive(Debug, Clone, PartialEq)]
15374#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15375#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15376#[cfg_attr(feature = "ts", derive(TS))]
15377#[cfg_attr(feature = "ts", ts(export))]
15378pub struct HIGHRES_IMU_DATA {
15379 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15380 pub time_usec: u64,
15381 #[doc = "X acceleration"]
15382 pub xacc: f32,
15383 #[doc = "Y acceleration"]
15384 pub yacc: f32,
15385 #[doc = "Z acceleration"]
15386 pub zacc: f32,
15387 #[doc = "Angular speed around X axis"]
15388 pub xgyro: f32,
15389 #[doc = "Angular speed around Y axis"]
15390 pub ygyro: f32,
15391 #[doc = "Angular speed around Z axis"]
15392 pub zgyro: f32,
15393 #[doc = "X Magnetic field"]
15394 pub xmag: f32,
15395 #[doc = "Y Magnetic field"]
15396 pub ymag: f32,
15397 #[doc = "Z Magnetic field"]
15398 pub zmag: f32,
15399 #[doc = "Absolute pressure"]
15400 pub abs_pressure: f32,
15401 #[doc = "Differential pressure"]
15402 pub diff_pressure: f32,
15403 #[doc = "Altitude calculated from pressure"]
15404 pub pressure_alt: f32,
15405 #[doc = "Temperature"]
15406 pub temperature: f32,
15407 #[doc = "Bitmap for fields that have updated since last message"]
15408 pub fields_updated: HighresImuUpdatedFlags,
15409 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
15410 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15411 pub id: u8,
15412}
15413impl HIGHRES_IMU_DATA {
15414 pub const ENCODED_LEN: usize = 63usize;
15415 pub const DEFAULT: Self = Self {
15416 time_usec: 0_u64,
15417 xacc: 0.0_f32,
15418 yacc: 0.0_f32,
15419 zacc: 0.0_f32,
15420 xgyro: 0.0_f32,
15421 ygyro: 0.0_f32,
15422 zgyro: 0.0_f32,
15423 xmag: 0.0_f32,
15424 ymag: 0.0_f32,
15425 zmag: 0.0_f32,
15426 abs_pressure: 0.0_f32,
15427 diff_pressure: 0.0_f32,
15428 pressure_alt: 0.0_f32,
15429 temperature: 0.0_f32,
15430 fields_updated: HighresImuUpdatedFlags::DEFAULT,
15431 id: 0_u8,
15432 };
15433 #[cfg(feature = "arbitrary")]
15434 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15435 use arbitrary::{Arbitrary, Unstructured};
15436 let mut buf = [0u8; 1024];
15437 rng.fill_bytes(&mut buf);
15438 let mut unstructured = Unstructured::new(&buf);
15439 Self::arbitrary(&mut unstructured).unwrap_or_default()
15440 }
15441}
15442impl Default for HIGHRES_IMU_DATA {
15443 fn default() -> Self {
15444 Self::DEFAULT.clone()
15445 }
15446}
15447impl MessageData for HIGHRES_IMU_DATA {
15448 type Message = MavMessage;
15449 const ID: u32 = 105u32;
15450 const NAME: &'static str = "HIGHRES_IMU";
15451 const EXTRA_CRC: u8 = 93u8;
15452 const ENCODED_LEN: usize = 63usize;
15453 fn deser(
15454 _version: MavlinkVersion,
15455 __input: &[u8],
15456 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15457 let avail_len = __input.len();
15458 let mut payload_buf = [0; Self::ENCODED_LEN];
15459 let mut buf = if avail_len < Self::ENCODED_LEN {
15460 payload_buf[0..avail_len].copy_from_slice(__input);
15461 Bytes::new(&payload_buf)
15462 } else {
15463 Bytes::new(__input)
15464 };
15465 let mut __struct = Self::default();
15466 __struct.time_usec = buf.get_u64_le();
15467 __struct.xacc = buf.get_f32_le();
15468 __struct.yacc = buf.get_f32_le();
15469 __struct.zacc = buf.get_f32_le();
15470 __struct.xgyro = buf.get_f32_le();
15471 __struct.ygyro = buf.get_f32_le();
15472 __struct.zgyro = buf.get_f32_le();
15473 __struct.xmag = buf.get_f32_le();
15474 __struct.ymag = buf.get_f32_le();
15475 __struct.zmag = buf.get_f32_le();
15476 __struct.abs_pressure = buf.get_f32_le();
15477 __struct.diff_pressure = buf.get_f32_le();
15478 __struct.pressure_alt = buf.get_f32_le();
15479 __struct.temperature = buf.get_f32_le();
15480 let tmp = buf.get_u16_le();
15481 __struct.fields_updated =
15482 HighresImuUpdatedFlags::from_bits(tmp as <HighresImuUpdatedFlags as Flags>::Bits)
15483 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15484 flag_type: "HighresImuUpdatedFlags",
15485 value: tmp as u64,
15486 })?;
15487 __struct.id = buf.get_u8();
15488 Ok(__struct)
15489 }
15490 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15491 let mut __tmp = BytesMut::new(bytes);
15492 #[allow(clippy::absurd_extreme_comparisons)]
15493 #[allow(unused_comparisons)]
15494 if __tmp.remaining() < Self::ENCODED_LEN {
15495 panic!(
15496 "buffer is too small (need {} bytes, but got {})",
15497 Self::ENCODED_LEN,
15498 __tmp.remaining(),
15499 )
15500 }
15501 __tmp.put_u64_le(self.time_usec);
15502 __tmp.put_f32_le(self.xacc);
15503 __tmp.put_f32_le(self.yacc);
15504 __tmp.put_f32_le(self.zacc);
15505 __tmp.put_f32_le(self.xgyro);
15506 __tmp.put_f32_le(self.ygyro);
15507 __tmp.put_f32_le(self.zgyro);
15508 __tmp.put_f32_le(self.xmag);
15509 __tmp.put_f32_le(self.ymag);
15510 __tmp.put_f32_le(self.zmag);
15511 __tmp.put_f32_le(self.abs_pressure);
15512 __tmp.put_f32_le(self.diff_pressure);
15513 __tmp.put_f32_le(self.pressure_alt);
15514 __tmp.put_f32_le(self.temperature);
15515 __tmp.put_u16_le(self.fields_updated.bits() as u16);
15516 if matches!(version, MavlinkVersion::V2) {
15517 __tmp.put_u8(self.id);
15518 let len = __tmp.len();
15519 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15520 } else {
15521 __tmp.len()
15522 }
15523 }
15524}
15525#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
15526#[doc = "Message appropriate for high latency connections like Iridium."]
15527#[doc = ""]
15528#[doc = "ID: 234"]
15529#[derive(Debug, Clone, PartialEq)]
15530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15531#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15532#[cfg_attr(feature = "ts", derive(TS))]
15533#[cfg_attr(feature = "ts", ts(export))]
15534pub struct HIGH_LATENCY_DATA {
15535 #[doc = "A bitfield for use for autopilot-specific flags."]
15536 pub custom_mode: u32,
15537 #[doc = "Latitude"]
15538 pub latitude: i32,
15539 #[doc = "Longitude"]
15540 pub longitude: i32,
15541 #[doc = "roll"]
15542 pub roll: i16,
15543 #[doc = "pitch"]
15544 pub pitch: i16,
15545 #[doc = "heading"]
15546 pub heading: u16,
15547 #[doc = "heading setpoint"]
15548 pub heading_sp: i16,
15549 #[doc = "Altitude above mean sea level"]
15550 pub altitude_amsl: i16,
15551 #[doc = "Altitude setpoint relative to the home position"]
15552 pub altitude_sp: i16,
15553 #[doc = "distance to target"]
15554 pub wp_distance: u16,
15555 #[doc = "Bitmap of enabled system modes."]
15556 pub base_mode: MavModeFlag,
15557 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
15558 pub landed_state: MavLandedState,
15559 #[doc = "throttle (percentage)"]
15560 pub throttle: i8,
15561 #[doc = "airspeed"]
15562 pub airspeed: u8,
15563 #[doc = "airspeed setpoint"]
15564 pub airspeed_sp: u8,
15565 #[doc = "groundspeed"]
15566 pub groundspeed: u8,
15567 #[doc = "climb rate"]
15568 pub climb_rate: i8,
15569 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15570 pub gps_nsat: u8,
15571 #[doc = "GPS Fix type."]
15572 pub gps_fix_type: GpsFixType,
15573 #[doc = "Remaining battery (percentage)"]
15574 pub battery_remaining: u8,
15575 #[doc = "Autopilot temperature (degrees C)"]
15576 pub temperature: i8,
15577 #[doc = "Air temperature (degrees C) from airspeed sensor"]
15578 pub temperature_air: i8,
15579 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
15580 pub failsafe: u8,
15581 #[doc = "current waypoint number"]
15582 pub wp_num: u8,
15583}
15584impl HIGH_LATENCY_DATA {
15585 pub const ENCODED_LEN: usize = 40usize;
15586 pub const DEFAULT: Self = Self {
15587 custom_mode: 0_u32,
15588 latitude: 0_i32,
15589 longitude: 0_i32,
15590 roll: 0_i16,
15591 pitch: 0_i16,
15592 heading: 0_u16,
15593 heading_sp: 0_i16,
15594 altitude_amsl: 0_i16,
15595 altitude_sp: 0_i16,
15596 wp_distance: 0_u16,
15597 base_mode: MavModeFlag::DEFAULT,
15598 landed_state: MavLandedState::DEFAULT,
15599 throttle: 0_i8,
15600 airspeed: 0_u8,
15601 airspeed_sp: 0_u8,
15602 groundspeed: 0_u8,
15603 climb_rate: 0_i8,
15604 gps_nsat: 0_u8,
15605 gps_fix_type: GpsFixType::DEFAULT,
15606 battery_remaining: 0_u8,
15607 temperature: 0_i8,
15608 temperature_air: 0_i8,
15609 failsafe: 0_u8,
15610 wp_num: 0_u8,
15611 };
15612 #[cfg(feature = "arbitrary")]
15613 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15614 use arbitrary::{Arbitrary, Unstructured};
15615 let mut buf = [0u8; 1024];
15616 rng.fill_bytes(&mut buf);
15617 let mut unstructured = Unstructured::new(&buf);
15618 Self::arbitrary(&mut unstructured).unwrap_or_default()
15619 }
15620}
15621impl Default for HIGH_LATENCY_DATA {
15622 fn default() -> Self {
15623 Self::DEFAULT.clone()
15624 }
15625}
15626impl MessageData for HIGH_LATENCY_DATA {
15627 type Message = MavMessage;
15628 const ID: u32 = 234u32;
15629 const NAME: &'static str = "HIGH_LATENCY";
15630 const EXTRA_CRC: u8 = 150u8;
15631 const ENCODED_LEN: usize = 40usize;
15632 fn deser(
15633 _version: MavlinkVersion,
15634 __input: &[u8],
15635 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15636 let avail_len = __input.len();
15637 let mut payload_buf = [0; Self::ENCODED_LEN];
15638 let mut buf = if avail_len < Self::ENCODED_LEN {
15639 payload_buf[0..avail_len].copy_from_slice(__input);
15640 Bytes::new(&payload_buf)
15641 } else {
15642 Bytes::new(__input)
15643 };
15644 let mut __struct = Self::default();
15645 __struct.custom_mode = buf.get_u32_le();
15646 __struct.latitude = buf.get_i32_le();
15647 __struct.longitude = buf.get_i32_le();
15648 __struct.roll = buf.get_i16_le();
15649 __struct.pitch = buf.get_i16_le();
15650 __struct.heading = buf.get_u16_le();
15651 __struct.heading_sp = buf.get_i16_le();
15652 __struct.altitude_amsl = buf.get_i16_le();
15653 __struct.altitude_sp = buf.get_i16_le();
15654 __struct.wp_distance = buf.get_u16_le();
15655 let tmp = buf.get_u8();
15656 __struct.base_mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
15657 ::mavlink_core::error::ParserError::InvalidFlag {
15658 flag_type: "MavModeFlag",
15659 value: tmp as u64,
15660 },
15661 )?;
15662 let tmp = buf.get_u8();
15663 __struct.landed_state =
15664 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15665 enum_type: "MavLandedState",
15666 value: tmp as u64,
15667 })?;
15668 __struct.throttle = buf.get_i8();
15669 __struct.airspeed = buf.get_u8();
15670 __struct.airspeed_sp = buf.get_u8();
15671 __struct.groundspeed = buf.get_u8();
15672 __struct.climb_rate = buf.get_i8();
15673 __struct.gps_nsat = buf.get_u8();
15674 let tmp = buf.get_u8();
15675 __struct.gps_fix_type =
15676 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15677 enum_type: "GpsFixType",
15678 value: tmp as u64,
15679 })?;
15680 __struct.battery_remaining = buf.get_u8();
15681 __struct.temperature = buf.get_i8();
15682 __struct.temperature_air = buf.get_i8();
15683 __struct.failsafe = buf.get_u8();
15684 __struct.wp_num = buf.get_u8();
15685 Ok(__struct)
15686 }
15687 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15688 let mut __tmp = BytesMut::new(bytes);
15689 #[allow(clippy::absurd_extreme_comparisons)]
15690 #[allow(unused_comparisons)]
15691 if __tmp.remaining() < Self::ENCODED_LEN {
15692 panic!(
15693 "buffer is too small (need {} bytes, but got {})",
15694 Self::ENCODED_LEN,
15695 __tmp.remaining(),
15696 )
15697 }
15698 __tmp.put_u32_le(self.custom_mode);
15699 __tmp.put_i32_le(self.latitude);
15700 __tmp.put_i32_le(self.longitude);
15701 __tmp.put_i16_le(self.roll);
15702 __tmp.put_i16_le(self.pitch);
15703 __tmp.put_u16_le(self.heading);
15704 __tmp.put_i16_le(self.heading_sp);
15705 __tmp.put_i16_le(self.altitude_amsl);
15706 __tmp.put_i16_le(self.altitude_sp);
15707 __tmp.put_u16_le(self.wp_distance);
15708 __tmp.put_u8(self.base_mode.bits() as u8);
15709 __tmp.put_u8(self.landed_state as u8);
15710 __tmp.put_i8(self.throttle);
15711 __tmp.put_u8(self.airspeed);
15712 __tmp.put_u8(self.airspeed_sp);
15713 __tmp.put_u8(self.groundspeed);
15714 __tmp.put_i8(self.climb_rate);
15715 __tmp.put_u8(self.gps_nsat);
15716 __tmp.put_u8(self.gps_fix_type as u8);
15717 __tmp.put_u8(self.battery_remaining);
15718 __tmp.put_i8(self.temperature);
15719 __tmp.put_i8(self.temperature_air);
15720 __tmp.put_u8(self.failsafe);
15721 __tmp.put_u8(self.wp_num);
15722 if matches!(version, MavlinkVersion::V2) {
15723 let len = __tmp.len();
15724 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15725 } else {
15726 __tmp.len()
15727 }
15728 }
15729}
15730#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
15731#[doc = ""]
15732#[doc = "ID: 235"]
15733#[derive(Debug, Clone, PartialEq)]
15734#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15735#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15736#[cfg_attr(feature = "ts", derive(TS))]
15737#[cfg_attr(feature = "ts", ts(export))]
15738pub struct HIGH_LATENCY2_DATA {
15739 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
15740 pub timestamp: u32,
15741 #[doc = "Latitude"]
15742 pub latitude: i32,
15743 #[doc = "Longitude"]
15744 pub longitude: i32,
15745 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
15746 pub custom_mode: u16,
15747 #[doc = "Altitude above mean sea level"]
15748 pub altitude: i16,
15749 #[doc = "Altitude setpoint"]
15750 pub target_altitude: i16,
15751 #[doc = "Distance to target waypoint or position"]
15752 pub target_distance: u16,
15753 #[doc = "Current waypoint number"]
15754 pub wp_num: u16,
15755 #[doc = "Bitmap of failure flags."]
15756 pub failure_flags: HlFailureFlag,
15757 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
15758 pub mavtype: MavType,
15759 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15760 pub autopilot: MavAutopilot,
15761 #[doc = "Heading"]
15762 pub heading: u8,
15763 #[doc = "Heading setpoint"]
15764 pub target_heading: u8,
15765 #[doc = "Throttle"]
15766 pub throttle: u8,
15767 #[doc = "Airspeed"]
15768 pub airspeed: u8,
15769 #[doc = "Airspeed setpoint"]
15770 pub airspeed_sp: u8,
15771 #[doc = "Groundspeed"]
15772 pub groundspeed: u8,
15773 #[doc = "Windspeed"]
15774 pub windspeed: u8,
15775 #[doc = "Wind heading"]
15776 pub wind_heading: u8,
15777 #[doc = "Maximum error horizontal position since last message"]
15778 pub eph: u8,
15779 #[doc = "Maximum error vertical position since last message"]
15780 pub epv: u8,
15781 #[doc = "Air temperature"]
15782 pub temperature_air: i8,
15783 #[doc = "Maximum climb rate magnitude since last message"]
15784 pub climb_rate: i8,
15785 #[doc = "Battery level (-1 if field not provided)."]
15786 pub battery: i8,
15787 #[doc = "Field for custom payload."]
15788 pub custom0: i8,
15789 #[doc = "Field for custom payload."]
15790 pub custom1: i8,
15791 #[doc = "Field for custom payload."]
15792 pub custom2: i8,
15793}
15794impl HIGH_LATENCY2_DATA {
15795 pub const ENCODED_LEN: usize = 42usize;
15796 pub const DEFAULT: Self = Self {
15797 timestamp: 0_u32,
15798 latitude: 0_i32,
15799 longitude: 0_i32,
15800 custom_mode: 0_u16,
15801 altitude: 0_i16,
15802 target_altitude: 0_i16,
15803 target_distance: 0_u16,
15804 wp_num: 0_u16,
15805 failure_flags: HlFailureFlag::DEFAULT,
15806 mavtype: MavType::DEFAULT,
15807 autopilot: MavAutopilot::DEFAULT,
15808 heading: 0_u8,
15809 target_heading: 0_u8,
15810 throttle: 0_u8,
15811 airspeed: 0_u8,
15812 airspeed_sp: 0_u8,
15813 groundspeed: 0_u8,
15814 windspeed: 0_u8,
15815 wind_heading: 0_u8,
15816 eph: 0_u8,
15817 epv: 0_u8,
15818 temperature_air: 0_i8,
15819 climb_rate: 0_i8,
15820 battery: 0_i8,
15821 custom0: 0_i8,
15822 custom1: 0_i8,
15823 custom2: 0_i8,
15824 };
15825 #[cfg(feature = "arbitrary")]
15826 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15827 use arbitrary::{Arbitrary, Unstructured};
15828 let mut buf = [0u8; 1024];
15829 rng.fill_bytes(&mut buf);
15830 let mut unstructured = Unstructured::new(&buf);
15831 Self::arbitrary(&mut unstructured).unwrap_or_default()
15832 }
15833}
15834impl Default for HIGH_LATENCY2_DATA {
15835 fn default() -> Self {
15836 Self::DEFAULT.clone()
15837 }
15838}
15839impl MessageData for HIGH_LATENCY2_DATA {
15840 type Message = MavMessage;
15841 const ID: u32 = 235u32;
15842 const NAME: &'static str = "HIGH_LATENCY2";
15843 const EXTRA_CRC: u8 = 179u8;
15844 const ENCODED_LEN: usize = 42usize;
15845 fn deser(
15846 _version: MavlinkVersion,
15847 __input: &[u8],
15848 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15849 let avail_len = __input.len();
15850 let mut payload_buf = [0; Self::ENCODED_LEN];
15851 let mut buf = if avail_len < Self::ENCODED_LEN {
15852 payload_buf[0..avail_len].copy_from_slice(__input);
15853 Bytes::new(&payload_buf)
15854 } else {
15855 Bytes::new(__input)
15856 };
15857 let mut __struct = Self::default();
15858 __struct.timestamp = buf.get_u32_le();
15859 __struct.latitude = buf.get_i32_le();
15860 __struct.longitude = buf.get_i32_le();
15861 __struct.custom_mode = buf.get_u16_le();
15862 __struct.altitude = buf.get_i16_le();
15863 __struct.target_altitude = buf.get_i16_le();
15864 __struct.target_distance = buf.get_u16_le();
15865 __struct.wp_num = buf.get_u16_le();
15866 let tmp = buf.get_u16_le();
15867 __struct.failure_flags = HlFailureFlag::from_bits(tmp as <HlFailureFlag as Flags>::Bits)
15868 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15869 flag_type: "HlFailureFlag",
15870 value: tmp as u64,
15871 })?;
15872 let tmp = buf.get_u8();
15873 __struct.mavtype =
15874 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15875 enum_type: "MavType",
15876 value: tmp as u64,
15877 })?;
15878 let tmp = buf.get_u8();
15879 __struct.autopilot =
15880 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15881 enum_type: "MavAutopilot",
15882 value: tmp as u64,
15883 })?;
15884 __struct.heading = buf.get_u8();
15885 __struct.target_heading = buf.get_u8();
15886 __struct.throttle = buf.get_u8();
15887 __struct.airspeed = buf.get_u8();
15888 __struct.airspeed_sp = buf.get_u8();
15889 __struct.groundspeed = buf.get_u8();
15890 __struct.windspeed = buf.get_u8();
15891 __struct.wind_heading = buf.get_u8();
15892 __struct.eph = buf.get_u8();
15893 __struct.epv = buf.get_u8();
15894 __struct.temperature_air = buf.get_i8();
15895 __struct.climb_rate = buf.get_i8();
15896 __struct.battery = buf.get_i8();
15897 __struct.custom0 = buf.get_i8();
15898 __struct.custom1 = buf.get_i8();
15899 __struct.custom2 = buf.get_i8();
15900 Ok(__struct)
15901 }
15902 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15903 let mut __tmp = BytesMut::new(bytes);
15904 #[allow(clippy::absurd_extreme_comparisons)]
15905 #[allow(unused_comparisons)]
15906 if __tmp.remaining() < Self::ENCODED_LEN {
15907 panic!(
15908 "buffer is too small (need {} bytes, but got {})",
15909 Self::ENCODED_LEN,
15910 __tmp.remaining(),
15911 )
15912 }
15913 __tmp.put_u32_le(self.timestamp);
15914 __tmp.put_i32_le(self.latitude);
15915 __tmp.put_i32_le(self.longitude);
15916 __tmp.put_u16_le(self.custom_mode);
15917 __tmp.put_i16_le(self.altitude);
15918 __tmp.put_i16_le(self.target_altitude);
15919 __tmp.put_u16_le(self.target_distance);
15920 __tmp.put_u16_le(self.wp_num);
15921 __tmp.put_u16_le(self.failure_flags.bits() as u16);
15922 __tmp.put_u8(self.mavtype as u8);
15923 __tmp.put_u8(self.autopilot as u8);
15924 __tmp.put_u8(self.heading);
15925 __tmp.put_u8(self.target_heading);
15926 __tmp.put_u8(self.throttle);
15927 __tmp.put_u8(self.airspeed);
15928 __tmp.put_u8(self.airspeed_sp);
15929 __tmp.put_u8(self.groundspeed);
15930 __tmp.put_u8(self.windspeed);
15931 __tmp.put_u8(self.wind_heading);
15932 __tmp.put_u8(self.eph);
15933 __tmp.put_u8(self.epv);
15934 __tmp.put_i8(self.temperature_air);
15935 __tmp.put_i8(self.climb_rate);
15936 __tmp.put_i8(self.battery);
15937 __tmp.put_i8(self.custom0);
15938 __tmp.put_i8(self.custom1);
15939 __tmp.put_i8(self.custom2);
15940 if matches!(version, MavlinkVersion::V2) {
15941 let len = __tmp.len();
15942 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15943 } else {
15944 __tmp.len()
15945 }
15946 }
15947}
15948#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
15949#[doc = ""]
15950#[doc = "ID: 93"]
15951#[derive(Debug, Clone, PartialEq)]
15952#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15953#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15954#[cfg_attr(feature = "ts", derive(TS))]
15955#[cfg_attr(feature = "ts", ts(export))]
15956pub struct HIL_ACTUATOR_CONTROLS_DATA {
15957 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15958 pub time_usec: u64,
15959 #[doc = "Flags bitmask."]
15960 pub flags: HilActuatorControlsFlags,
15961 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
15962 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15963 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15964 pub controls: [f32; 16],
15965 #[doc = "System mode. Includes arming state."]
15966 pub mode: MavModeFlag,
15967}
15968impl HIL_ACTUATOR_CONTROLS_DATA {
15969 pub const ENCODED_LEN: usize = 81usize;
15970 pub const DEFAULT: Self = Self {
15971 time_usec: 0_u64,
15972 flags: HilActuatorControlsFlags::DEFAULT,
15973 controls: [0.0_f32; 16usize],
15974 mode: MavModeFlag::DEFAULT,
15975 };
15976 #[cfg(feature = "arbitrary")]
15977 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15978 use arbitrary::{Arbitrary, Unstructured};
15979 let mut buf = [0u8; 1024];
15980 rng.fill_bytes(&mut buf);
15981 let mut unstructured = Unstructured::new(&buf);
15982 Self::arbitrary(&mut unstructured).unwrap_or_default()
15983 }
15984}
15985impl Default for HIL_ACTUATOR_CONTROLS_DATA {
15986 fn default() -> Self {
15987 Self::DEFAULT.clone()
15988 }
15989}
15990impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
15991 type Message = MavMessage;
15992 const ID: u32 = 93u32;
15993 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
15994 const EXTRA_CRC: u8 = 47u8;
15995 const ENCODED_LEN: usize = 81usize;
15996 fn deser(
15997 _version: MavlinkVersion,
15998 __input: &[u8],
15999 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16000 let avail_len = __input.len();
16001 let mut payload_buf = [0; Self::ENCODED_LEN];
16002 let mut buf = if avail_len < Self::ENCODED_LEN {
16003 payload_buf[0..avail_len].copy_from_slice(__input);
16004 Bytes::new(&payload_buf)
16005 } else {
16006 Bytes::new(__input)
16007 };
16008 let mut __struct = Self::default();
16009 __struct.time_usec = buf.get_u64_le();
16010 let tmp = buf.get_u64_le();
16011 __struct.flags =
16012 HilActuatorControlsFlags::from_bits(tmp as <HilActuatorControlsFlags as Flags>::Bits)
16013 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16014 flag_type: "HilActuatorControlsFlags",
16015 value: tmp as u64,
16016 })?;
16017 for v in &mut __struct.controls {
16018 let val = buf.get_f32_le();
16019 *v = val;
16020 }
16021 let tmp = buf.get_u8();
16022 __struct.mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
16023 ::mavlink_core::error::ParserError::InvalidFlag {
16024 flag_type: "MavModeFlag",
16025 value: tmp as u64,
16026 },
16027 )?;
16028 Ok(__struct)
16029 }
16030 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16031 let mut __tmp = BytesMut::new(bytes);
16032 #[allow(clippy::absurd_extreme_comparisons)]
16033 #[allow(unused_comparisons)]
16034 if __tmp.remaining() < Self::ENCODED_LEN {
16035 panic!(
16036 "buffer is too small (need {} bytes, but got {})",
16037 Self::ENCODED_LEN,
16038 __tmp.remaining(),
16039 )
16040 }
16041 __tmp.put_u64_le(self.time_usec);
16042 __tmp.put_u64_le(self.flags.bits() as u64);
16043 for val in &self.controls {
16044 __tmp.put_f32_le(*val);
16045 }
16046 __tmp.put_u8(self.mode.bits() as u8);
16047 if matches!(version, MavlinkVersion::V2) {
16048 let len = __tmp.len();
16049 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16050 } else {
16051 __tmp.len()
16052 }
16053 }
16054}
16055#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
16056#[doc = ""]
16057#[doc = "ID: 91"]
16058#[derive(Debug, Clone, PartialEq)]
16059#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16060#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16061#[cfg_attr(feature = "ts", derive(TS))]
16062#[cfg_attr(feature = "ts", ts(export))]
16063pub struct HIL_CONTROLS_DATA {
16064 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16065 pub time_usec: u64,
16066 #[doc = "Control output -1 .. 1"]
16067 pub roll_ailerons: f32,
16068 #[doc = "Control output -1 .. 1"]
16069 pub pitch_elevator: f32,
16070 #[doc = "Control output -1 .. 1"]
16071 pub yaw_rudder: f32,
16072 #[doc = "Throttle 0 .. 1"]
16073 pub throttle: f32,
16074 #[doc = "Aux 1, -1 .. 1"]
16075 pub aux1: f32,
16076 #[doc = "Aux 2, -1 .. 1"]
16077 pub aux2: f32,
16078 #[doc = "Aux 3, -1 .. 1"]
16079 pub aux3: f32,
16080 #[doc = "Aux 4, -1 .. 1"]
16081 pub aux4: f32,
16082 #[doc = "System mode."]
16083 pub mode: MavMode,
16084 #[doc = "Navigation mode (MAV_NAV_MODE)"]
16085 pub nav_mode: u8,
16086}
16087impl HIL_CONTROLS_DATA {
16088 pub const ENCODED_LEN: usize = 42usize;
16089 pub const DEFAULT: Self = Self {
16090 time_usec: 0_u64,
16091 roll_ailerons: 0.0_f32,
16092 pitch_elevator: 0.0_f32,
16093 yaw_rudder: 0.0_f32,
16094 throttle: 0.0_f32,
16095 aux1: 0.0_f32,
16096 aux2: 0.0_f32,
16097 aux3: 0.0_f32,
16098 aux4: 0.0_f32,
16099 mode: MavMode::DEFAULT,
16100 nav_mode: 0_u8,
16101 };
16102 #[cfg(feature = "arbitrary")]
16103 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16104 use arbitrary::{Arbitrary, Unstructured};
16105 let mut buf = [0u8; 1024];
16106 rng.fill_bytes(&mut buf);
16107 let mut unstructured = Unstructured::new(&buf);
16108 Self::arbitrary(&mut unstructured).unwrap_or_default()
16109 }
16110}
16111impl Default for HIL_CONTROLS_DATA {
16112 fn default() -> Self {
16113 Self::DEFAULT.clone()
16114 }
16115}
16116impl MessageData for HIL_CONTROLS_DATA {
16117 type Message = MavMessage;
16118 const ID: u32 = 91u32;
16119 const NAME: &'static str = "HIL_CONTROLS";
16120 const EXTRA_CRC: u8 = 63u8;
16121 const ENCODED_LEN: usize = 42usize;
16122 fn deser(
16123 _version: MavlinkVersion,
16124 __input: &[u8],
16125 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16126 let avail_len = __input.len();
16127 let mut payload_buf = [0; Self::ENCODED_LEN];
16128 let mut buf = if avail_len < Self::ENCODED_LEN {
16129 payload_buf[0..avail_len].copy_from_slice(__input);
16130 Bytes::new(&payload_buf)
16131 } else {
16132 Bytes::new(__input)
16133 };
16134 let mut __struct = Self::default();
16135 __struct.time_usec = buf.get_u64_le();
16136 __struct.roll_ailerons = buf.get_f32_le();
16137 __struct.pitch_elevator = buf.get_f32_le();
16138 __struct.yaw_rudder = buf.get_f32_le();
16139 __struct.throttle = buf.get_f32_le();
16140 __struct.aux1 = buf.get_f32_le();
16141 __struct.aux2 = buf.get_f32_le();
16142 __struct.aux3 = buf.get_f32_le();
16143 __struct.aux4 = buf.get_f32_le();
16144 let tmp = buf.get_u8();
16145 __struct.mode =
16146 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16147 enum_type: "MavMode",
16148 value: tmp as u64,
16149 })?;
16150 __struct.nav_mode = buf.get_u8();
16151 Ok(__struct)
16152 }
16153 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16154 let mut __tmp = BytesMut::new(bytes);
16155 #[allow(clippy::absurd_extreme_comparisons)]
16156 #[allow(unused_comparisons)]
16157 if __tmp.remaining() < Self::ENCODED_LEN {
16158 panic!(
16159 "buffer is too small (need {} bytes, but got {})",
16160 Self::ENCODED_LEN,
16161 __tmp.remaining(),
16162 )
16163 }
16164 __tmp.put_u64_le(self.time_usec);
16165 __tmp.put_f32_le(self.roll_ailerons);
16166 __tmp.put_f32_le(self.pitch_elevator);
16167 __tmp.put_f32_le(self.yaw_rudder);
16168 __tmp.put_f32_le(self.throttle);
16169 __tmp.put_f32_le(self.aux1);
16170 __tmp.put_f32_le(self.aux2);
16171 __tmp.put_f32_le(self.aux3);
16172 __tmp.put_f32_le(self.aux4);
16173 __tmp.put_u8(self.mode as u8);
16174 __tmp.put_u8(self.nav_mode);
16175 if matches!(version, MavlinkVersion::V2) {
16176 let len = __tmp.len();
16177 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16178 } else {
16179 __tmp.len()
16180 }
16181 }
16182}
16183#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
16184#[doc = ""]
16185#[doc = "ID: 113"]
16186#[derive(Debug, Clone, PartialEq)]
16187#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16188#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16189#[cfg_attr(feature = "ts", derive(TS))]
16190#[cfg_attr(feature = "ts", ts(export))]
16191pub struct HIL_GPS_DATA {
16192 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16193 pub time_usec: u64,
16194 #[doc = "Latitude (WGS84)"]
16195 pub lat: i32,
16196 #[doc = "Longitude (WGS84)"]
16197 pub lon: i32,
16198 #[doc = "Altitude (MSL). Positive for up."]
16199 pub alt: i32,
16200 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16201 pub eph: u16,
16202 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16203 pub epv: u16,
16204 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
16205 pub vel: u16,
16206 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
16207 pub vn: i16,
16208 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
16209 pub ve: i16,
16210 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
16211 pub vd: i16,
16212 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
16213 pub cog: u16,
16214 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
16215 pub fix_type: u8,
16216 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
16217 pub satellites_visible: u8,
16218 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
16219 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16220 pub id: u8,
16221 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
16222 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16223 pub yaw: u16,
16224}
16225impl HIL_GPS_DATA {
16226 pub const ENCODED_LEN: usize = 39usize;
16227 pub const DEFAULT: Self = Self {
16228 time_usec: 0_u64,
16229 lat: 0_i32,
16230 lon: 0_i32,
16231 alt: 0_i32,
16232 eph: 0_u16,
16233 epv: 0_u16,
16234 vel: 0_u16,
16235 vn: 0_i16,
16236 ve: 0_i16,
16237 vd: 0_i16,
16238 cog: 0_u16,
16239 fix_type: 0_u8,
16240 satellites_visible: 0_u8,
16241 id: 0_u8,
16242 yaw: 0_u16,
16243 };
16244 #[cfg(feature = "arbitrary")]
16245 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16246 use arbitrary::{Arbitrary, Unstructured};
16247 let mut buf = [0u8; 1024];
16248 rng.fill_bytes(&mut buf);
16249 let mut unstructured = Unstructured::new(&buf);
16250 Self::arbitrary(&mut unstructured).unwrap_or_default()
16251 }
16252}
16253impl Default for HIL_GPS_DATA {
16254 fn default() -> Self {
16255 Self::DEFAULT.clone()
16256 }
16257}
16258impl MessageData for HIL_GPS_DATA {
16259 type Message = MavMessage;
16260 const ID: u32 = 113u32;
16261 const NAME: &'static str = "HIL_GPS";
16262 const EXTRA_CRC: u8 = 124u8;
16263 const ENCODED_LEN: usize = 39usize;
16264 fn deser(
16265 _version: MavlinkVersion,
16266 __input: &[u8],
16267 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16268 let avail_len = __input.len();
16269 let mut payload_buf = [0; Self::ENCODED_LEN];
16270 let mut buf = if avail_len < Self::ENCODED_LEN {
16271 payload_buf[0..avail_len].copy_from_slice(__input);
16272 Bytes::new(&payload_buf)
16273 } else {
16274 Bytes::new(__input)
16275 };
16276 let mut __struct = Self::default();
16277 __struct.time_usec = buf.get_u64_le();
16278 __struct.lat = buf.get_i32_le();
16279 __struct.lon = buf.get_i32_le();
16280 __struct.alt = buf.get_i32_le();
16281 __struct.eph = buf.get_u16_le();
16282 __struct.epv = buf.get_u16_le();
16283 __struct.vel = buf.get_u16_le();
16284 __struct.vn = buf.get_i16_le();
16285 __struct.ve = buf.get_i16_le();
16286 __struct.vd = buf.get_i16_le();
16287 __struct.cog = buf.get_u16_le();
16288 __struct.fix_type = buf.get_u8();
16289 __struct.satellites_visible = buf.get_u8();
16290 __struct.id = buf.get_u8();
16291 __struct.yaw = buf.get_u16_le();
16292 Ok(__struct)
16293 }
16294 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16295 let mut __tmp = BytesMut::new(bytes);
16296 #[allow(clippy::absurd_extreme_comparisons)]
16297 #[allow(unused_comparisons)]
16298 if __tmp.remaining() < Self::ENCODED_LEN {
16299 panic!(
16300 "buffer is too small (need {} bytes, but got {})",
16301 Self::ENCODED_LEN,
16302 __tmp.remaining(),
16303 )
16304 }
16305 __tmp.put_u64_le(self.time_usec);
16306 __tmp.put_i32_le(self.lat);
16307 __tmp.put_i32_le(self.lon);
16308 __tmp.put_i32_le(self.alt);
16309 __tmp.put_u16_le(self.eph);
16310 __tmp.put_u16_le(self.epv);
16311 __tmp.put_u16_le(self.vel);
16312 __tmp.put_i16_le(self.vn);
16313 __tmp.put_i16_le(self.ve);
16314 __tmp.put_i16_le(self.vd);
16315 __tmp.put_u16_le(self.cog);
16316 __tmp.put_u8(self.fix_type);
16317 __tmp.put_u8(self.satellites_visible);
16318 if matches!(version, MavlinkVersion::V2) {
16319 __tmp.put_u8(self.id);
16320 __tmp.put_u16_le(self.yaw);
16321 let len = __tmp.len();
16322 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16323 } else {
16324 __tmp.len()
16325 }
16326 }
16327}
16328#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
16329#[doc = ""]
16330#[doc = "ID: 114"]
16331#[derive(Debug, Clone, PartialEq)]
16332#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16333#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16334#[cfg_attr(feature = "ts", derive(TS))]
16335#[cfg_attr(feature = "ts", ts(export))]
16336pub struct HIL_OPTICAL_FLOW_DATA {
16337 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16338 pub time_usec: u64,
16339 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
16340 pub integration_time_us: u32,
16341 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
16342 pub integrated_x: f32,
16343 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
16344 pub integrated_y: f32,
16345 #[doc = "RH rotation around X axis"]
16346 pub integrated_xgyro: f32,
16347 #[doc = "RH rotation around Y axis"]
16348 pub integrated_ygyro: f32,
16349 #[doc = "RH rotation around Z axis"]
16350 pub integrated_zgyro: f32,
16351 #[doc = "Time since the distance was sampled."]
16352 pub time_delta_distance_us: u32,
16353 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
16354 pub distance: f32,
16355 #[doc = "Temperature"]
16356 pub temperature: i16,
16357 #[doc = "Sensor ID"]
16358 pub sensor_id: u8,
16359 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
16360 pub quality: u8,
16361}
16362impl HIL_OPTICAL_FLOW_DATA {
16363 pub const ENCODED_LEN: usize = 44usize;
16364 pub const DEFAULT: Self = Self {
16365 time_usec: 0_u64,
16366 integration_time_us: 0_u32,
16367 integrated_x: 0.0_f32,
16368 integrated_y: 0.0_f32,
16369 integrated_xgyro: 0.0_f32,
16370 integrated_ygyro: 0.0_f32,
16371 integrated_zgyro: 0.0_f32,
16372 time_delta_distance_us: 0_u32,
16373 distance: 0.0_f32,
16374 temperature: 0_i16,
16375 sensor_id: 0_u8,
16376 quality: 0_u8,
16377 };
16378 #[cfg(feature = "arbitrary")]
16379 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16380 use arbitrary::{Arbitrary, Unstructured};
16381 let mut buf = [0u8; 1024];
16382 rng.fill_bytes(&mut buf);
16383 let mut unstructured = Unstructured::new(&buf);
16384 Self::arbitrary(&mut unstructured).unwrap_or_default()
16385 }
16386}
16387impl Default for HIL_OPTICAL_FLOW_DATA {
16388 fn default() -> Self {
16389 Self::DEFAULT.clone()
16390 }
16391}
16392impl MessageData for HIL_OPTICAL_FLOW_DATA {
16393 type Message = MavMessage;
16394 const ID: u32 = 114u32;
16395 const NAME: &'static str = "HIL_OPTICAL_FLOW";
16396 const EXTRA_CRC: u8 = 237u8;
16397 const ENCODED_LEN: usize = 44usize;
16398 fn deser(
16399 _version: MavlinkVersion,
16400 __input: &[u8],
16401 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16402 let avail_len = __input.len();
16403 let mut payload_buf = [0; Self::ENCODED_LEN];
16404 let mut buf = if avail_len < Self::ENCODED_LEN {
16405 payload_buf[0..avail_len].copy_from_slice(__input);
16406 Bytes::new(&payload_buf)
16407 } else {
16408 Bytes::new(__input)
16409 };
16410 let mut __struct = Self::default();
16411 __struct.time_usec = buf.get_u64_le();
16412 __struct.integration_time_us = buf.get_u32_le();
16413 __struct.integrated_x = buf.get_f32_le();
16414 __struct.integrated_y = buf.get_f32_le();
16415 __struct.integrated_xgyro = buf.get_f32_le();
16416 __struct.integrated_ygyro = buf.get_f32_le();
16417 __struct.integrated_zgyro = buf.get_f32_le();
16418 __struct.time_delta_distance_us = buf.get_u32_le();
16419 __struct.distance = buf.get_f32_le();
16420 __struct.temperature = buf.get_i16_le();
16421 __struct.sensor_id = buf.get_u8();
16422 __struct.quality = buf.get_u8();
16423 Ok(__struct)
16424 }
16425 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16426 let mut __tmp = BytesMut::new(bytes);
16427 #[allow(clippy::absurd_extreme_comparisons)]
16428 #[allow(unused_comparisons)]
16429 if __tmp.remaining() < Self::ENCODED_LEN {
16430 panic!(
16431 "buffer is too small (need {} bytes, but got {})",
16432 Self::ENCODED_LEN,
16433 __tmp.remaining(),
16434 )
16435 }
16436 __tmp.put_u64_le(self.time_usec);
16437 __tmp.put_u32_le(self.integration_time_us);
16438 __tmp.put_f32_le(self.integrated_x);
16439 __tmp.put_f32_le(self.integrated_y);
16440 __tmp.put_f32_le(self.integrated_xgyro);
16441 __tmp.put_f32_le(self.integrated_ygyro);
16442 __tmp.put_f32_le(self.integrated_zgyro);
16443 __tmp.put_u32_le(self.time_delta_distance_us);
16444 __tmp.put_f32_le(self.distance);
16445 __tmp.put_i16_le(self.temperature);
16446 __tmp.put_u8(self.sensor_id);
16447 __tmp.put_u8(self.quality);
16448 if matches!(version, MavlinkVersion::V2) {
16449 let len = __tmp.len();
16450 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16451 } else {
16452 __tmp.len()
16453 }
16454 }
16455}
16456#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
16457#[doc = ""]
16458#[doc = "ID: 92"]
16459#[derive(Debug, Clone, PartialEq)]
16460#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16461#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16462#[cfg_attr(feature = "ts", derive(TS))]
16463#[cfg_attr(feature = "ts", ts(export))]
16464pub struct HIL_RC_INPUTS_RAW_DATA {
16465 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16466 pub time_usec: u64,
16467 #[doc = "RC channel 1 value"]
16468 pub chan1_raw: u16,
16469 #[doc = "RC channel 2 value"]
16470 pub chan2_raw: u16,
16471 #[doc = "RC channel 3 value"]
16472 pub chan3_raw: u16,
16473 #[doc = "RC channel 4 value"]
16474 pub chan4_raw: u16,
16475 #[doc = "RC channel 5 value"]
16476 pub chan5_raw: u16,
16477 #[doc = "RC channel 6 value"]
16478 pub chan6_raw: u16,
16479 #[doc = "RC channel 7 value"]
16480 pub chan7_raw: u16,
16481 #[doc = "RC channel 8 value"]
16482 pub chan8_raw: u16,
16483 #[doc = "RC channel 9 value"]
16484 pub chan9_raw: u16,
16485 #[doc = "RC channel 10 value"]
16486 pub chan10_raw: u16,
16487 #[doc = "RC channel 11 value"]
16488 pub chan11_raw: u16,
16489 #[doc = "RC channel 12 value"]
16490 pub chan12_raw: u16,
16491 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
16492 pub rssi: u8,
16493}
16494impl HIL_RC_INPUTS_RAW_DATA {
16495 pub const ENCODED_LEN: usize = 33usize;
16496 pub const DEFAULT: Self = Self {
16497 time_usec: 0_u64,
16498 chan1_raw: 0_u16,
16499 chan2_raw: 0_u16,
16500 chan3_raw: 0_u16,
16501 chan4_raw: 0_u16,
16502 chan5_raw: 0_u16,
16503 chan6_raw: 0_u16,
16504 chan7_raw: 0_u16,
16505 chan8_raw: 0_u16,
16506 chan9_raw: 0_u16,
16507 chan10_raw: 0_u16,
16508 chan11_raw: 0_u16,
16509 chan12_raw: 0_u16,
16510 rssi: 0_u8,
16511 };
16512 #[cfg(feature = "arbitrary")]
16513 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16514 use arbitrary::{Arbitrary, Unstructured};
16515 let mut buf = [0u8; 1024];
16516 rng.fill_bytes(&mut buf);
16517 let mut unstructured = Unstructured::new(&buf);
16518 Self::arbitrary(&mut unstructured).unwrap_or_default()
16519 }
16520}
16521impl Default for HIL_RC_INPUTS_RAW_DATA {
16522 fn default() -> Self {
16523 Self::DEFAULT.clone()
16524 }
16525}
16526impl MessageData for HIL_RC_INPUTS_RAW_DATA {
16527 type Message = MavMessage;
16528 const ID: u32 = 92u32;
16529 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
16530 const EXTRA_CRC: u8 = 54u8;
16531 const ENCODED_LEN: usize = 33usize;
16532 fn deser(
16533 _version: MavlinkVersion,
16534 __input: &[u8],
16535 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16536 let avail_len = __input.len();
16537 let mut payload_buf = [0; Self::ENCODED_LEN];
16538 let mut buf = if avail_len < Self::ENCODED_LEN {
16539 payload_buf[0..avail_len].copy_from_slice(__input);
16540 Bytes::new(&payload_buf)
16541 } else {
16542 Bytes::new(__input)
16543 };
16544 let mut __struct = Self::default();
16545 __struct.time_usec = buf.get_u64_le();
16546 __struct.chan1_raw = buf.get_u16_le();
16547 __struct.chan2_raw = buf.get_u16_le();
16548 __struct.chan3_raw = buf.get_u16_le();
16549 __struct.chan4_raw = buf.get_u16_le();
16550 __struct.chan5_raw = buf.get_u16_le();
16551 __struct.chan6_raw = buf.get_u16_le();
16552 __struct.chan7_raw = buf.get_u16_le();
16553 __struct.chan8_raw = buf.get_u16_le();
16554 __struct.chan9_raw = buf.get_u16_le();
16555 __struct.chan10_raw = buf.get_u16_le();
16556 __struct.chan11_raw = buf.get_u16_le();
16557 __struct.chan12_raw = buf.get_u16_le();
16558 __struct.rssi = buf.get_u8();
16559 Ok(__struct)
16560 }
16561 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16562 let mut __tmp = BytesMut::new(bytes);
16563 #[allow(clippy::absurd_extreme_comparisons)]
16564 #[allow(unused_comparisons)]
16565 if __tmp.remaining() < Self::ENCODED_LEN {
16566 panic!(
16567 "buffer is too small (need {} bytes, but got {})",
16568 Self::ENCODED_LEN,
16569 __tmp.remaining(),
16570 )
16571 }
16572 __tmp.put_u64_le(self.time_usec);
16573 __tmp.put_u16_le(self.chan1_raw);
16574 __tmp.put_u16_le(self.chan2_raw);
16575 __tmp.put_u16_le(self.chan3_raw);
16576 __tmp.put_u16_le(self.chan4_raw);
16577 __tmp.put_u16_le(self.chan5_raw);
16578 __tmp.put_u16_le(self.chan6_raw);
16579 __tmp.put_u16_le(self.chan7_raw);
16580 __tmp.put_u16_le(self.chan8_raw);
16581 __tmp.put_u16_le(self.chan9_raw);
16582 __tmp.put_u16_le(self.chan10_raw);
16583 __tmp.put_u16_le(self.chan11_raw);
16584 __tmp.put_u16_le(self.chan12_raw);
16585 __tmp.put_u8(self.rssi);
16586 if matches!(version, MavlinkVersion::V2) {
16587 let len = __tmp.len();
16588 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16589 } else {
16590 __tmp.len()
16591 }
16592 }
16593}
16594#[doc = "The IMU readings in SI units in NED body frame."]
16595#[doc = ""]
16596#[doc = "ID: 107"]
16597#[derive(Debug, Clone, PartialEq)]
16598#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16599#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16600#[cfg_attr(feature = "ts", derive(TS))]
16601#[cfg_attr(feature = "ts", ts(export))]
16602pub struct HIL_SENSOR_DATA {
16603 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16604 pub time_usec: u64,
16605 #[doc = "X acceleration"]
16606 pub xacc: f32,
16607 #[doc = "Y acceleration"]
16608 pub yacc: f32,
16609 #[doc = "Z acceleration"]
16610 pub zacc: f32,
16611 #[doc = "Angular speed around X axis in body frame"]
16612 pub xgyro: f32,
16613 #[doc = "Angular speed around Y axis in body frame"]
16614 pub ygyro: f32,
16615 #[doc = "Angular speed around Z axis in body frame"]
16616 pub zgyro: f32,
16617 #[doc = "X Magnetic field"]
16618 pub xmag: f32,
16619 #[doc = "Y Magnetic field"]
16620 pub ymag: f32,
16621 #[doc = "Z Magnetic field"]
16622 pub zmag: f32,
16623 #[doc = "Absolute pressure"]
16624 pub abs_pressure: f32,
16625 #[doc = "Differential pressure (airspeed)"]
16626 pub diff_pressure: f32,
16627 #[doc = "Altitude calculated from pressure"]
16628 pub pressure_alt: f32,
16629 #[doc = "Temperature"]
16630 pub temperature: f32,
16631 #[doc = "Bitmap for fields that have updated since last message"]
16632 pub fields_updated: HilSensorUpdatedFlags,
16633 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
16634 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16635 pub id: u8,
16636}
16637impl HIL_SENSOR_DATA {
16638 pub const ENCODED_LEN: usize = 65usize;
16639 pub const DEFAULT: Self = Self {
16640 time_usec: 0_u64,
16641 xacc: 0.0_f32,
16642 yacc: 0.0_f32,
16643 zacc: 0.0_f32,
16644 xgyro: 0.0_f32,
16645 ygyro: 0.0_f32,
16646 zgyro: 0.0_f32,
16647 xmag: 0.0_f32,
16648 ymag: 0.0_f32,
16649 zmag: 0.0_f32,
16650 abs_pressure: 0.0_f32,
16651 diff_pressure: 0.0_f32,
16652 pressure_alt: 0.0_f32,
16653 temperature: 0.0_f32,
16654 fields_updated: HilSensorUpdatedFlags::DEFAULT,
16655 id: 0_u8,
16656 };
16657 #[cfg(feature = "arbitrary")]
16658 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16659 use arbitrary::{Arbitrary, Unstructured};
16660 let mut buf = [0u8; 1024];
16661 rng.fill_bytes(&mut buf);
16662 let mut unstructured = Unstructured::new(&buf);
16663 Self::arbitrary(&mut unstructured).unwrap_or_default()
16664 }
16665}
16666impl Default for HIL_SENSOR_DATA {
16667 fn default() -> Self {
16668 Self::DEFAULT.clone()
16669 }
16670}
16671impl MessageData for HIL_SENSOR_DATA {
16672 type Message = MavMessage;
16673 const ID: u32 = 107u32;
16674 const NAME: &'static str = "HIL_SENSOR";
16675 const EXTRA_CRC: u8 = 108u8;
16676 const ENCODED_LEN: usize = 65usize;
16677 fn deser(
16678 _version: MavlinkVersion,
16679 __input: &[u8],
16680 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16681 let avail_len = __input.len();
16682 let mut payload_buf = [0; Self::ENCODED_LEN];
16683 let mut buf = if avail_len < Self::ENCODED_LEN {
16684 payload_buf[0..avail_len].copy_from_slice(__input);
16685 Bytes::new(&payload_buf)
16686 } else {
16687 Bytes::new(__input)
16688 };
16689 let mut __struct = Self::default();
16690 __struct.time_usec = buf.get_u64_le();
16691 __struct.xacc = buf.get_f32_le();
16692 __struct.yacc = buf.get_f32_le();
16693 __struct.zacc = buf.get_f32_le();
16694 __struct.xgyro = buf.get_f32_le();
16695 __struct.ygyro = buf.get_f32_le();
16696 __struct.zgyro = buf.get_f32_le();
16697 __struct.xmag = buf.get_f32_le();
16698 __struct.ymag = buf.get_f32_le();
16699 __struct.zmag = buf.get_f32_le();
16700 __struct.abs_pressure = buf.get_f32_le();
16701 __struct.diff_pressure = buf.get_f32_le();
16702 __struct.pressure_alt = buf.get_f32_le();
16703 __struct.temperature = buf.get_f32_le();
16704 let tmp = buf.get_u32_le();
16705 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
16706 tmp as <HilSensorUpdatedFlags as Flags>::Bits,
16707 )
16708 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16709 flag_type: "HilSensorUpdatedFlags",
16710 value: tmp as u64,
16711 })?;
16712 __struct.id = buf.get_u8();
16713 Ok(__struct)
16714 }
16715 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16716 let mut __tmp = BytesMut::new(bytes);
16717 #[allow(clippy::absurd_extreme_comparisons)]
16718 #[allow(unused_comparisons)]
16719 if __tmp.remaining() < Self::ENCODED_LEN {
16720 panic!(
16721 "buffer is too small (need {} bytes, but got {})",
16722 Self::ENCODED_LEN,
16723 __tmp.remaining(),
16724 )
16725 }
16726 __tmp.put_u64_le(self.time_usec);
16727 __tmp.put_f32_le(self.xacc);
16728 __tmp.put_f32_le(self.yacc);
16729 __tmp.put_f32_le(self.zacc);
16730 __tmp.put_f32_le(self.xgyro);
16731 __tmp.put_f32_le(self.ygyro);
16732 __tmp.put_f32_le(self.zgyro);
16733 __tmp.put_f32_le(self.xmag);
16734 __tmp.put_f32_le(self.ymag);
16735 __tmp.put_f32_le(self.zmag);
16736 __tmp.put_f32_le(self.abs_pressure);
16737 __tmp.put_f32_le(self.diff_pressure);
16738 __tmp.put_f32_le(self.pressure_alt);
16739 __tmp.put_f32_le(self.temperature);
16740 __tmp.put_u32_le(self.fields_updated.bits() as u32);
16741 if matches!(version, MavlinkVersion::V2) {
16742 __tmp.put_u8(self.id);
16743 let len = __tmp.len();
16744 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16745 } else {
16746 __tmp.len()
16747 }
16748 }
16749}
16750#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
16751#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16752#[doc = ""]
16753#[doc = "ID: 90"]
16754#[derive(Debug, Clone, PartialEq)]
16755#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16756#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16757#[cfg_attr(feature = "ts", derive(TS))]
16758#[cfg_attr(feature = "ts", ts(export))]
16759pub struct HIL_STATE_DATA {
16760 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16761 pub time_usec: u64,
16762 #[doc = "Roll angle"]
16763 pub roll: f32,
16764 #[doc = "Pitch angle"]
16765 pub pitch: f32,
16766 #[doc = "Yaw angle"]
16767 pub yaw: f32,
16768 #[doc = "Body frame roll / phi angular speed"]
16769 pub rollspeed: f32,
16770 #[doc = "Body frame pitch / theta angular speed"]
16771 pub pitchspeed: f32,
16772 #[doc = "Body frame yaw / psi angular speed"]
16773 pub yawspeed: f32,
16774 #[doc = "Latitude"]
16775 pub lat: i32,
16776 #[doc = "Longitude"]
16777 pub lon: i32,
16778 #[doc = "Altitude"]
16779 pub alt: i32,
16780 #[doc = "Ground X Speed (Latitude)"]
16781 pub vx: i16,
16782 #[doc = "Ground Y Speed (Longitude)"]
16783 pub vy: i16,
16784 #[doc = "Ground Z Speed (Altitude)"]
16785 pub vz: i16,
16786 #[doc = "X acceleration"]
16787 pub xacc: i16,
16788 #[doc = "Y acceleration"]
16789 pub yacc: i16,
16790 #[doc = "Z acceleration"]
16791 pub zacc: i16,
16792}
16793impl HIL_STATE_DATA {
16794 pub const ENCODED_LEN: usize = 56usize;
16795 pub const DEFAULT: Self = Self {
16796 time_usec: 0_u64,
16797 roll: 0.0_f32,
16798 pitch: 0.0_f32,
16799 yaw: 0.0_f32,
16800 rollspeed: 0.0_f32,
16801 pitchspeed: 0.0_f32,
16802 yawspeed: 0.0_f32,
16803 lat: 0_i32,
16804 lon: 0_i32,
16805 alt: 0_i32,
16806 vx: 0_i16,
16807 vy: 0_i16,
16808 vz: 0_i16,
16809 xacc: 0_i16,
16810 yacc: 0_i16,
16811 zacc: 0_i16,
16812 };
16813 #[cfg(feature = "arbitrary")]
16814 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16815 use arbitrary::{Arbitrary, Unstructured};
16816 let mut buf = [0u8; 1024];
16817 rng.fill_bytes(&mut buf);
16818 let mut unstructured = Unstructured::new(&buf);
16819 Self::arbitrary(&mut unstructured).unwrap_or_default()
16820 }
16821}
16822impl Default for HIL_STATE_DATA {
16823 fn default() -> Self {
16824 Self::DEFAULT.clone()
16825 }
16826}
16827impl MessageData for HIL_STATE_DATA {
16828 type Message = MavMessage;
16829 const ID: u32 = 90u32;
16830 const NAME: &'static str = "HIL_STATE";
16831 const EXTRA_CRC: u8 = 183u8;
16832 const ENCODED_LEN: usize = 56usize;
16833 fn deser(
16834 _version: MavlinkVersion,
16835 __input: &[u8],
16836 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16837 let avail_len = __input.len();
16838 let mut payload_buf = [0; Self::ENCODED_LEN];
16839 let mut buf = if avail_len < Self::ENCODED_LEN {
16840 payload_buf[0..avail_len].copy_from_slice(__input);
16841 Bytes::new(&payload_buf)
16842 } else {
16843 Bytes::new(__input)
16844 };
16845 let mut __struct = Self::default();
16846 __struct.time_usec = buf.get_u64_le();
16847 __struct.roll = buf.get_f32_le();
16848 __struct.pitch = buf.get_f32_le();
16849 __struct.yaw = buf.get_f32_le();
16850 __struct.rollspeed = buf.get_f32_le();
16851 __struct.pitchspeed = buf.get_f32_le();
16852 __struct.yawspeed = buf.get_f32_le();
16853 __struct.lat = buf.get_i32_le();
16854 __struct.lon = buf.get_i32_le();
16855 __struct.alt = buf.get_i32_le();
16856 __struct.vx = buf.get_i16_le();
16857 __struct.vy = buf.get_i16_le();
16858 __struct.vz = buf.get_i16_le();
16859 __struct.xacc = buf.get_i16_le();
16860 __struct.yacc = buf.get_i16_le();
16861 __struct.zacc = buf.get_i16_le();
16862 Ok(__struct)
16863 }
16864 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16865 let mut __tmp = BytesMut::new(bytes);
16866 #[allow(clippy::absurd_extreme_comparisons)]
16867 #[allow(unused_comparisons)]
16868 if __tmp.remaining() < Self::ENCODED_LEN {
16869 panic!(
16870 "buffer is too small (need {} bytes, but got {})",
16871 Self::ENCODED_LEN,
16872 __tmp.remaining(),
16873 )
16874 }
16875 __tmp.put_u64_le(self.time_usec);
16876 __tmp.put_f32_le(self.roll);
16877 __tmp.put_f32_le(self.pitch);
16878 __tmp.put_f32_le(self.yaw);
16879 __tmp.put_f32_le(self.rollspeed);
16880 __tmp.put_f32_le(self.pitchspeed);
16881 __tmp.put_f32_le(self.yawspeed);
16882 __tmp.put_i32_le(self.lat);
16883 __tmp.put_i32_le(self.lon);
16884 __tmp.put_i32_le(self.alt);
16885 __tmp.put_i16_le(self.vx);
16886 __tmp.put_i16_le(self.vy);
16887 __tmp.put_i16_le(self.vz);
16888 __tmp.put_i16_le(self.xacc);
16889 __tmp.put_i16_le(self.yacc);
16890 __tmp.put_i16_le(self.zacc);
16891 if matches!(version, MavlinkVersion::V2) {
16892 let len = __tmp.len();
16893 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16894 } else {
16895 __tmp.len()
16896 }
16897 }
16898}
16899#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16900#[doc = ""]
16901#[doc = "ID: 115"]
16902#[derive(Debug, Clone, PartialEq)]
16903#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16904#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16905#[cfg_attr(feature = "ts", derive(TS))]
16906#[cfg_attr(feature = "ts", ts(export))]
16907pub struct HIL_STATE_QUATERNION_DATA {
16908 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16909 pub time_usec: u64,
16910 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
16911 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16912 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16913 pub attitude_quaternion: [f32; 4],
16914 #[doc = "Body frame roll / phi angular speed"]
16915 pub rollspeed: f32,
16916 #[doc = "Body frame pitch / theta angular speed"]
16917 pub pitchspeed: f32,
16918 #[doc = "Body frame yaw / psi angular speed"]
16919 pub yawspeed: f32,
16920 #[doc = "Latitude"]
16921 pub lat: i32,
16922 #[doc = "Longitude"]
16923 pub lon: i32,
16924 #[doc = "Altitude"]
16925 pub alt: i32,
16926 #[doc = "Ground X Speed (Latitude)"]
16927 pub vx: i16,
16928 #[doc = "Ground Y Speed (Longitude)"]
16929 pub vy: i16,
16930 #[doc = "Ground Z Speed (Altitude)"]
16931 pub vz: i16,
16932 #[doc = "Indicated airspeed"]
16933 pub ind_airspeed: u16,
16934 #[doc = "True airspeed"]
16935 pub true_airspeed: u16,
16936 #[doc = "X acceleration"]
16937 pub xacc: i16,
16938 #[doc = "Y acceleration"]
16939 pub yacc: i16,
16940 #[doc = "Z acceleration"]
16941 pub zacc: i16,
16942}
16943impl HIL_STATE_QUATERNION_DATA {
16944 pub const ENCODED_LEN: usize = 64usize;
16945 pub const DEFAULT: Self = Self {
16946 time_usec: 0_u64,
16947 attitude_quaternion: [0.0_f32; 4usize],
16948 rollspeed: 0.0_f32,
16949 pitchspeed: 0.0_f32,
16950 yawspeed: 0.0_f32,
16951 lat: 0_i32,
16952 lon: 0_i32,
16953 alt: 0_i32,
16954 vx: 0_i16,
16955 vy: 0_i16,
16956 vz: 0_i16,
16957 ind_airspeed: 0_u16,
16958 true_airspeed: 0_u16,
16959 xacc: 0_i16,
16960 yacc: 0_i16,
16961 zacc: 0_i16,
16962 };
16963 #[cfg(feature = "arbitrary")]
16964 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16965 use arbitrary::{Arbitrary, Unstructured};
16966 let mut buf = [0u8; 1024];
16967 rng.fill_bytes(&mut buf);
16968 let mut unstructured = Unstructured::new(&buf);
16969 Self::arbitrary(&mut unstructured).unwrap_or_default()
16970 }
16971}
16972impl Default for HIL_STATE_QUATERNION_DATA {
16973 fn default() -> Self {
16974 Self::DEFAULT.clone()
16975 }
16976}
16977impl MessageData for HIL_STATE_QUATERNION_DATA {
16978 type Message = MavMessage;
16979 const ID: u32 = 115u32;
16980 const NAME: &'static str = "HIL_STATE_QUATERNION";
16981 const EXTRA_CRC: u8 = 4u8;
16982 const ENCODED_LEN: usize = 64usize;
16983 fn deser(
16984 _version: MavlinkVersion,
16985 __input: &[u8],
16986 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16987 let avail_len = __input.len();
16988 let mut payload_buf = [0; Self::ENCODED_LEN];
16989 let mut buf = if avail_len < Self::ENCODED_LEN {
16990 payload_buf[0..avail_len].copy_from_slice(__input);
16991 Bytes::new(&payload_buf)
16992 } else {
16993 Bytes::new(__input)
16994 };
16995 let mut __struct = Self::default();
16996 __struct.time_usec = buf.get_u64_le();
16997 for v in &mut __struct.attitude_quaternion {
16998 let val = buf.get_f32_le();
16999 *v = val;
17000 }
17001 __struct.rollspeed = buf.get_f32_le();
17002 __struct.pitchspeed = buf.get_f32_le();
17003 __struct.yawspeed = buf.get_f32_le();
17004 __struct.lat = buf.get_i32_le();
17005 __struct.lon = buf.get_i32_le();
17006 __struct.alt = buf.get_i32_le();
17007 __struct.vx = buf.get_i16_le();
17008 __struct.vy = buf.get_i16_le();
17009 __struct.vz = buf.get_i16_le();
17010 __struct.ind_airspeed = buf.get_u16_le();
17011 __struct.true_airspeed = buf.get_u16_le();
17012 __struct.xacc = buf.get_i16_le();
17013 __struct.yacc = buf.get_i16_le();
17014 __struct.zacc = buf.get_i16_le();
17015 Ok(__struct)
17016 }
17017 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17018 let mut __tmp = BytesMut::new(bytes);
17019 #[allow(clippy::absurd_extreme_comparisons)]
17020 #[allow(unused_comparisons)]
17021 if __tmp.remaining() < Self::ENCODED_LEN {
17022 panic!(
17023 "buffer is too small (need {} bytes, but got {})",
17024 Self::ENCODED_LEN,
17025 __tmp.remaining(),
17026 )
17027 }
17028 __tmp.put_u64_le(self.time_usec);
17029 for val in &self.attitude_quaternion {
17030 __tmp.put_f32_le(*val);
17031 }
17032 __tmp.put_f32_le(self.rollspeed);
17033 __tmp.put_f32_le(self.pitchspeed);
17034 __tmp.put_f32_le(self.yawspeed);
17035 __tmp.put_i32_le(self.lat);
17036 __tmp.put_i32_le(self.lon);
17037 __tmp.put_i32_le(self.alt);
17038 __tmp.put_i16_le(self.vx);
17039 __tmp.put_i16_le(self.vy);
17040 __tmp.put_i16_le(self.vz);
17041 __tmp.put_u16_le(self.ind_airspeed);
17042 __tmp.put_u16_le(self.true_airspeed);
17043 __tmp.put_i16_le(self.xacc);
17044 __tmp.put_i16_le(self.yacc);
17045 __tmp.put_i16_le(self.zacc);
17046 if matches!(version, MavlinkVersion::V2) {
17047 let len = __tmp.len();
17048 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17049 } else {
17050 __tmp.len()
17051 }
17052 }
17053}
17054#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
17055#[doc = ""]
17056#[doc = "ID: 242"]
17057#[derive(Debug, Clone, PartialEq)]
17058#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17059#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17060#[cfg_attr(feature = "ts", derive(TS))]
17061#[cfg_attr(feature = "ts", ts(export))]
17062pub struct HOME_POSITION_DATA {
17063 #[doc = "Latitude (WGS84)"]
17064 pub latitude: i32,
17065 #[doc = "Longitude (WGS84)"]
17066 pub longitude: i32,
17067 #[doc = "Altitude (MSL). Positive for up."]
17068 pub altitude: i32,
17069 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
17070 pub x: f32,
17071 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
17072 pub y: f32,
17073 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
17074 pub z: f32,
17075 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
17076 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17077 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17078 pub q: [f32; 4],
17079 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17080 pub approach_x: f32,
17081 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17082 pub approach_y: f32,
17083 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17084 pub approach_z: f32,
17085 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17086 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17087 pub time_usec: u64,
17088}
17089impl HOME_POSITION_DATA {
17090 pub const ENCODED_LEN: usize = 60usize;
17091 pub const DEFAULT: Self = Self {
17092 latitude: 0_i32,
17093 longitude: 0_i32,
17094 altitude: 0_i32,
17095 x: 0.0_f32,
17096 y: 0.0_f32,
17097 z: 0.0_f32,
17098 q: [0.0_f32; 4usize],
17099 approach_x: 0.0_f32,
17100 approach_y: 0.0_f32,
17101 approach_z: 0.0_f32,
17102 time_usec: 0_u64,
17103 };
17104 #[cfg(feature = "arbitrary")]
17105 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17106 use arbitrary::{Arbitrary, Unstructured};
17107 let mut buf = [0u8; 1024];
17108 rng.fill_bytes(&mut buf);
17109 let mut unstructured = Unstructured::new(&buf);
17110 Self::arbitrary(&mut unstructured).unwrap_or_default()
17111 }
17112}
17113impl Default for HOME_POSITION_DATA {
17114 fn default() -> Self {
17115 Self::DEFAULT.clone()
17116 }
17117}
17118impl MessageData for HOME_POSITION_DATA {
17119 type Message = MavMessage;
17120 const ID: u32 = 242u32;
17121 const NAME: &'static str = "HOME_POSITION";
17122 const EXTRA_CRC: u8 = 104u8;
17123 const ENCODED_LEN: usize = 60usize;
17124 fn deser(
17125 _version: MavlinkVersion,
17126 __input: &[u8],
17127 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17128 let avail_len = __input.len();
17129 let mut payload_buf = [0; Self::ENCODED_LEN];
17130 let mut buf = if avail_len < Self::ENCODED_LEN {
17131 payload_buf[0..avail_len].copy_from_slice(__input);
17132 Bytes::new(&payload_buf)
17133 } else {
17134 Bytes::new(__input)
17135 };
17136 let mut __struct = Self::default();
17137 __struct.latitude = buf.get_i32_le();
17138 __struct.longitude = buf.get_i32_le();
17139 __struct.altitude = buf.get_i32_le();
17140 __struct.x = buf.get_f32_le();
17141 __struct.y = buf.get_f32_le();
17142 __struct.z = buf.get_f32_le();
17143 for v in &mut __struct.q {
17144 let val = buf.get_f32_le();
17145 *v = val;
17146 }
17147 __struct.approach_x = buf.get_f32_le();
17148 __struct.approach_y = buf.get_f32_le();
17149 __struct.approach_z = buf.get_f32_le();
17150 __struct.time_usec = buf.get_u64_le();
17151 Ok(__struct)
17152 }
17153 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17154 let mut __tmp = BytesMut::new(bytes);
17155 #[allow(clippy::absurd_extreme_comparisons)]
17156 #[allow(unused_comparisons)]
17157 if __tmp.remaining() < Self::ENCODED_LEN {
17158 panic!(
17159 "buffer is too small (need {} bytes, but got {})",
17160 Self::ENCODED_LEN,
17161 __tmp.remaining(),
17162 )
17163 }
17164 __tmp.put_i32_le(self.latitude);
17165 __tmp.put_i32_le(self.longitude);
17166 __tmp.put_i32_le(self.altitude);
17167 __tmp.put_f32_le(self.x);
17168 __tmp.put_f32_le(self.y);
17169 __tmp.put_f32_le(self.z);
17170 for val in &self.q {
17171 __tmp.put_f32_le(*val);
17172 }
17173 __tmp.put_f32_le(self.approach_x);
17174 __tmp.put_f32_le(self.approach_y);
17175 __tmp.put_f32_le(self.approach_z);
17176 if matches!(version, MavlinkVersion::V2) {
17177 __tmp.put_u64_le(self.time_usec);
17178 let len = __tmp.len();
17179 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17180 } else {
17181 __tmp.len()
17182 }
17183 }
17184}
17185#[doc = "Temperature and humidity from hygrometer."]
17186#[doc = ""]
17187#[doc = "ID: 12920"]
17188#[derive(Debug, Clone, PartialEq)]
17189#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17190#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17191#[cfg_attr(feature = "ts", derive(TS))]
17192#[cfg_attr(feature = "ts", ts(export))]
17193pub struct HYGROMETER_SENSOR_DATA {
17194 #[doc = "Temperature"]
17195 pub temperature: i16,
17196 #[doc = "Humidity"]
17197 pub humidity: u16,
17198 #[doc = "Hygrometer ID"]
17199 pub id: u8,
17200}
17201impl HYGROMETER_SENSOR_DATA {
17202 pub const ENCODED_LEN: usize = 5usize;
17203 pub const DEFAULT: Self = Self {
17204 temperature: 0_i16,
17205 humidity: 0_u16,
17206 id: 0_u8,
17207 };
17208 #[cfg(feature = "arbitrary")]
17209 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17210 use arbitrary::{Arbitrary, Unstructured};
17211 let mut buf = [0u8; 1024];
17212 rng.fill_bytes(&mut buf);
17213 let mut unstructured = Unstructured::new(&buf);
17214 Self::arbitrary(&mut unstructured).unwrap_or_default()
17215 }
17216}
17217impl Default for HYGROMETER_SENSOR_DATA {
17218 fn default() -> Self {
17219 Self::DEFAULT.clone()
17220 }
17221}
17222impl MessageData for HYGROMETER_SENSOR_DATA {
17223 type Message = MavMessage;
17224 const ID: u32 = 12920u32;
17225 const NAME: &'static str = "HYGROMETER_SENSOR";
17226 const EXTRA_CRC: u8 = 20u8;
17227 const ENCODED_LEN: usize = 5usize;
17228 fn deser(
17229 _version: MavlinkVersion,
17230 __input: &[u8],
17231 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17232 let avail_len = __input.len();
17233 let mut payload_buf = [0; Self::ENCODED_LEN];
17234 let mut buf = if avail_len < Self::ENCODED_LEN {
17235 payload_buf[0..avail_len].copy_from_slice(__input);
17236 Bytes::new(&payload_buf)
17237 } else {
17238 Bytes::new(__input)
17239 };
17240 let mut __struct = Self::default();
17241 __struct.temperature = buf.get_i16_le();
17242 __struct.humidity = buf.get_u16_le();
17243 __struct.id = buf.get_u8();
17244 Ok(__struct)
17245 }
17246 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17247 let mut __tmp = BytesMut::new(bytes);
17248 #[allow(clippy::absurd_extreme_comparisons)]
17249 #[allow(unused_comparisons)]
17250 if __tmp.remaining() < Self::ENCODED_LEN {
17251 panic!(
17252 "buffer is too small (need {} bytes, but got {})",
17253 Self::ENCODED_LEN,
17254 __tmp.remaining(),
17255 )
17256 }
17257 __tmp.put_i16_le(self.temperature);
17258 __tmp.put_u16_le(self.humidity);
17259 __tmp.put_u8(self.id);
17260 if matches!(version, MavlinkVersion::V2) {
17261 let len = __tmp.len();
17262 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17263 } else {
17264 __tmp.len()
17265 }
17266 }
17267}
17268#[doc = "Illuminator status."]
17269#[doc = ""]
17270#[doc = "ID: 440"]
17271#[derive(Debug, Clone, PartialEq)]
17272#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17273#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17274#[cfg_attr(feature = "ts", derive(TS))]
17275#[cfg_attr(feature = "ts", ts(export))]
17276pub struct ILLUMINATOR_STATUS_DATA {
17277 #[doc = "Time since the start-up of the illuminator in ms"]
17278 pub uptime_ms: u32,
17279 #[doc = "Errors"]
17280 pub error_status: IlluminatorErrorFlags,
17281 #[doc = "Illuminator brightness"]
17282 pub brightness: f32,
17283 #[doc = "Illuminator strobing period in seconds"]
17284 pub strobe_period: f32,
17285 #[doc = "Illuminator strobing duty cycle"]
17286 pub strobe_duty_cycle: f32,
17287 #[doc = "Temperature in Celsius"]
17288 pub temp_c: f32,
17289 #[doc = "Minimum strobing period in seconds"]
17290 pub min_strobe_period: f32,
17291 #[doc = "Maximum strobing period in seconds"]
17292 pub max_strobe_period: f32,
17293 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
17294 pub enable: u8,
17295 #[doc = "Supported illuminator modes"]
17296 pub mode_bitmask: IlluminatorMode,
17297 #[doc = "Illuminator mode"]
17298 pub mode: IlluminatorMode,
17299}
17300impl ILLUMINATOR_STATUS_DATA {
17301 pub const ENCODED_LEN: usize = 35usize;
17302 pub const DEFAULT: Self = Self {
17303 uptime_ms: 0_u32,
17304 error_status: IlluminatorErrorFlags::DEFAULT,
17305 brightness: 0.0_f32,
17306 strobe_period: 0.0_f32,
17307 strobe_duty_cycle: 0.0_f32,
17308 temp_c: 0.0_f32,
17309 min_strobe_period: 0.0_f32,
17310 max_strobe_period: 0.0_f32,
17311 enable: 0_u8,
17312 mode_bitmask: IlluminatorMode::DEFAULT,
17313 mode: IlluminatorMode::DEFAULT,
17314 };
17315 #[cfg(feature = "arbitrary")]
17316 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17317 use arbitrary::{Arbitrary, Unstructured};
17318 let mut buf = [0u8; 1024];
17319 rng.fill_bytes(&mut buf);
17320 let mut unstructured = Unstructured::new(&buf);
17321 Self::arbitrary(&mut unstructured).unwrap_or_default()
17322 }
17323}
17324impl Default for ILLUMINATOR_STATUS_DATA {
17325 fn default() -> Self {
17326 Self::DEFAULT.clone()
17327 }
17328}
17329impl MessageData for ILLUMINATOR_STATUS_DATA {
17330 type Message = MavMessage;
17331 const ID: u32 = 440u32;
17332 const NAME: &'static str = "ILLUMINATOR_STATUS";
17333 const EXTRA_CRC: u8 = 66u8;
17334 const ENCODED_LEN: usize = 35usize;
17335 fn deser(
17336 _version: MavlinkVersion,
17337 __input: &[u8],
17338 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17339 let avail_len = __input.len();
17340 let mut payload_buf = [0; Self::ENCODED_LEN];
17341 let mut buf = if avail_len < Self::ENCODED_LEN {
17342 payload_buf[0..avail_len].copy_from_slice(__input);
17343 Bytes::new(&payload_buf)
17344 } else {
17345 Bytes::new(__input)
17346 };
17347 let mut __struct = Self::default();
17348 __struct.uptime_ms = buf.get_u32_le();
17349 let tmp = buf.get_u32_le();
17350 __struct.error_status = IlluminatorErrorFlags::from_bits(
17351 tmp as <IlluminatorErrorFlags as Flags>::Bits,
17352 )
17353 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17354 flag_type: "IlluminatorErrorFlags",
17355 value: tmp as u64,
17356 })?;
17357 __struct.brightness = buf.get_f32_le();
17358 __struct.strobe_period = buf.get_f32_le();
17359 __struct.strobe_duty_cycle = buf.get_f32_le();
17360 __struct.temp_c = buf.get_f32_le();
17361 __struct.min_strobe_period = buf.get_f32_le();
17362 __struct.max_strobe_period = buf.get_f32_le();
17363 __struct.enable = buf.get_u8();
17364 let tmp = buf.get_u8();
17365 __struct.mode_bitmask =
17366 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17367 enum_type: "IlluminatorMode",
17368 value: tmp as u64,
17369 })?;
17370 let tmp = buf.get_u8();
17371 __struct.mode =
17372 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17373 enum_type: "IlluminatorMode",
17374 value: tmp as u64,
17375 })?;
17376 Ok(__struct)
17377 }
17378 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17379 let mut __tmp = BytesMut::new(bytes);
17380 #[allow(clippy::absurd_extreme_comparisons)]
17381 #[allow(unused_comparisons)]
17382 if __tmp.remaining() < Self::ENCODED_LEN {
17383 panic!(
17384 "buffer is too small (need {} bytes, but got {})",
17385 Self::ENCODED_LEN,
17386 __tmp.remaining(),
17387 )
17388 }
17389 __tmp.put_u32_le(self.uptime_ms);
17390 __tmp.put_u32_le(self.error_status.bits() as u32);
17391 __tmp.put_f32_le(self.brightness);
17392 __tmp.put_f32_le(self.strobe_period);
17393 __tmp.put_f32_le(self.strobe_duty_cycle);
17394 __tmp.put_f32_le(self.temp_c);
17395 __tmp.put_f32_le(self.min_strobe_period);
17396 __tmp.put_f32_le(self.max_strobe_period);
17397 __tmp.put_u8(self.enable);
17398 __tmp.put_u8(self.mode_bitmask as u8);
17399 __tmp.put_u8(self.mode as u8);
17400 if matches!(version, MavlinkVersion::V2) {
17401 let len = __tmp.len();
17402 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17403 } else {
17404 __tmp.len()
17405 }
17406 }
17407}
17408#[doc = "Status of the Iridium SBD link."]
17409#[doc = ""]
17410#[doc = "ID: 335"]
17411#[derive(Debug, Clone, PartialEq)]
17412#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17413#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17414#[cfg_attr(feature = "ts", derive(TS))]
17415#[cfg_attr(feature = "ts", ts(export))]
17416pub struct ISBD_LINK_STATUS_DATA {
17417 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17418 pub timestamp: u64,
17419 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17420 pub last_heartbeat: u64,
17421 #[doc = "Number of failed SBD sessions."]
17422 pub failed_sessions: u16,
17423 #[doc = "Number of successful SBD sessions."]
17424 pub successful_sessions: u16,
17425 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
17426 pub signal_quality: u8,
17427 #[doc = "1: Ring call pending, 0: No call pending."]
17428 pub ring_pending: u8,
17429 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
17430 pub tx_session_pending: u8,
17431 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
17432 pub rx_session_pending: u8,
17433}
17434impl ISBD_LINK_STATUS_DATA {
17435 pub const ENCODED_LEN: usize = 24usize;
17436 pub const DEFAULT: Self = Self {
17437 timestamp: 0_u64,
17438 last_heartbeat: 0_u64,
17439 failed_sessions: 0_u16,
17440 successful_sessions: 0_u16,
17441 signal_quality: 0_u8,
17442 ring_pending: 0_u8,
17443 tx_session_pending: 0_u8,
17444 rx_session_pending: 0_u8,
17445 };
17446 #[cfg(feature = "arbitrary")]
17447 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17448 use arbitrary::{Arbitrary, Unstructured};
17449 let mut buf = [0u8; 1024];
17450 rng.fill_bytes(&mut buf);
17451 let mut unstructured = Unstructured::new(&buf);
17452 Self::arbitrary(&mut unstructured).unwrap_or_default()
17453 }
17454}
17455impl Default for ISBD_LINK_STATUS_DATA {
17456 fn default() -> Self {
17457 Self::DEFAULT.clone()
17458 }
17459}
17460impl MessageData for ISBD_LINK_STATUS_DATA {
17461 type Message = MavMessage;
17462 const ID: u32 = 335u32;
17463 const NAME: &'static str = "ISBD_LINK_STATUS";
17464 const EXTRA_CRC: u8 = 225u8;
17465 const ENCODED_LEN: usize = 24usize;
17466 fn deser(
17467 _version: MavlinkVersion,
17468 __input: &[u8],
17469 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17470 let avail_len = __input.len();
17471 let mut payload_buf = [0; Self::ENCODED_LEN];
17472 let mut buf = if avail_len < Self::ENCODED_LEN {
17473 payload_buf[0..avail_len].copy_from_slice(__input);
17474 Bytes::new(&payload_buf)
17475 } else {
17476 Bytes::new(__input)
17477 };
17478 let mut __struct = Self::default();
17479 __struct.timestamp = buf.get_u64_le();
17480 __struct.last_heartbeat = buf.get_u64_le();
17481 __struct.failed_sessions = buf.get_u16_le();
17482 __struct.successful_sessions = buf.get_u16_le();
17483 __struct.signal_quality = buf.get_u8();
17484 __struct.ring_pending = buf.get_u8();
17485 __struct.tx_session_pending = buf.get_u8();
17486 __struct.rx_session_pending = buf.get_u8();
17487 Ok(__struct)
17488 }
17489 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17490 let mut __tmp = BytesMut::new(bytes);
17491 #[allow(clippy::absurd_extreme_comparisons)]
17492 #[allow(unused_comparisons)]
17493 if __tmp.remaining() < Self::ENCODED_LEN {
17494 panic!(
17495 "buffer is too small (need {} bytes, but got {})",
17496 Self::ENCODED_LEN,
17497 __tmp.remaining(),
17498 )
17499 }
17500 __tmp.put_u64_le(self.timestamp);
17501 __tmp.put_u64_le(self.last_heartbeat);
17502 __tmp.put_u16_le(self.failed_sessions);
17503 __tmp.put_u16_le(self.successful_sessions);
17504 __tmp.put_u8(self.signal_quality);
17505 __tmp.put_u8(self.ring_pending);
17506 __tmp.put_u8(self.tx_session_pending);
17507 __tmp.put_u8(self.rx_session_pending);
17508 if matches!(version, MavlinkVersion::V2) {
17509 let len = __tmp.len();
17510 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17511 } else {
17512 __tmp.len()
17513 }
17514 }
17515}
17516#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
17517#[doc = ""]
17518#[doc = "ID: 149"]
17519#[derive(Debug, Clone, PartialEq)]
17520#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17521#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17522#[cfg_attr(feature = "ts", derive(TS))]
17523#[cfg_attr(feature = "ts", ts(export))]
17524pub struct LANDING_TARGET_DATA {
17525 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17526 pub time_usec: u64,
17527 #[doc = "X-axis angular offset of the target from the center of the image"]
17528 pub angle_x: f32,
17529 #[doc = "Y-axis angular offset of the target from the center of the image"]
17530 pub angle_y: f32,
17531 #[doc = "Distance to the target from the vehicle"]
17532 pub distance: f32,
17533 #[doc = "Size of target along x-axis"]
17534 pub size_x: f32,
17535 #[doc = "Size of target along y-axis"]
17536 pub size_y: f32,
17537 #[doc = "The ID of the target if multiple targets are present"]
17538 pub target_num: u8,
17539 #[doc = "Coordinate frame used for following fields."]
17540 pub frame: MavFrame,
17541 #[doc = "X Position of the landing target in MAV_FRAME"]
17542 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17543 pub x: f32,
17544 #[doc = "Y Position of the landing target in MAV_FRAME"]
17545 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17546 pub y: f32,
17547 #[doc = "Z Position of the landing target in MAV_FRAME"]
17548 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17549 pub z: f32,
17550 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
17551 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17552 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17553 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17554 pub q: [f32; 4],
17555 #[doc = "Type of landing target"]
17556 #[cfg_attr(feature = "serde", serde(default))]
17557 pub mavtype: LandingTargetType,
17558 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
17559 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17560 pub position_valid: u8,
17561}
17562impl LANDING_TARGET_DATA {
17563 pub const ENCODED_LEN: usize = 60usize;
17564 pub const DEFAULT: Self = Self {
17565 time_usec: 0_u64,
17566 angle_x: 0.0_f32,
17567 angle_y: 0.0_f32,
17568 distance: 0.0_f32,
17569 size_x: 0.0_f32,
17570 size_y: 0.0_f32,
17571 target_num: 0_u8,
17572 frame: MavFrame::DEFAULT,
17573 x: 0.0_f32,
17574 y: 0.0_f32,
17575 z: 0.0_f32,
17576 q: [0.0_f32; 4usize],
17577 mavtype: LandingTargetType::DEFAULT,
17578 position_valid: 0_u8,
17579 };
17580 #[cfg(feature = "arbitrary")]
17581 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17582 use arbitrary::{Arbitrary, Unstructured};
17583 let mut buf = [0u8; 1024];
17584 rng.fill_bytes(&mut buf);
17585 let mut unstructured = Unstructured::new(&buf);
17586 Self::arbitrary(&mut unstructured).unwrap_or_default()
17587 }
17588}
17589impl Default for LANDING_TARGET_DATA {
17590 fn default() -> Self {
17591 Self::DEFAULT.clone()
17592 }
17593}
17594impl MessageData for LANDING_TARGET_DATA {
17595 type Message = MavMessage;
17596 const ID: u32 = 149u32;
17597 const NAME: &'static str = "LANDING_TARGET";
17598 const EXTRA_CRC: u8 = 200u8;
17599 const ENCODED_LEN: usize = 60usize;
17600 fn deser(
17601 _version: MavlinkVersion,
17602 __input: &[u8],
17603 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17604 let avail_len = __input.len();
17605 let mut payload_buf = [0; Self::ENCODED_LEN];
17606 let mut buf = if avail_len < Self::ENCODED_LEN {
17607 payload_buf[0..avail_len].copy_from_slice(__input);
17608 Bytes::new(&payload_buf)
17609 } else {
17610 Bytes::new(__input)
17611 };
17612 let mut __struct = Self::default();
17613 __struct.time_usec = buf.get_u64_le();
17614 __struct.angle_x = buf.get_f32_le();
17615 __struct.angle_y = buf.get_f32_le();
17616 __struct.distance = buf.get_f32_le();
17617 __struct.size_x = buf.get_f32_le();
17618 __struct.size_y = buf.get_f32_le();
17619 __struct.target_num = buf.get_u8();
17620 let tmp = buf.get_u8();
17621 __struct.frame =
17622 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17623 enum_type: "MavFrame",
17624 value: tmp as u64,
17625 })?;
17626 __struct.x = buf.get_f32_le();
17627 __struct.y = buf.get_f32_le();
17628 __struct.z = buf.get_f32_le();
17629 for v in &mut __struct.q {
17630 let val = buf.get_f32_le();
17631 *v = val;
17632 }
17633 let tmp = buf.get_u8();
17634 __struct.mavtype =
17635 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17636 enum_type: "LandingTargetType",
17637 value: tmp as u64,
17638 })?;
17639 __struct.position_valid = buf.get_u8();
17640 Ok(__struct)
17641 }
17642 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17643 let mut __tmp = BytesMut::new(bytes);
17644 #[allow(clippy::absurd_extreme_comparisons)]
17645 #[allow(unused_comparisons)]
17646 if __tmp.remaining() < Self::ENCODED_LEN {
17647 panic!(
17648 "buffer is too small (need {} bytes, but got {})",
17649 Self::ENCODED_LEN,
17650 __tmp.remaining(),
17651 )
17652 }
17653 __tmp.put_u64_le(self.time_usec);
17654 __tmp.put_f32_le(self.angle_x);
17655 __tmp.put_f32_le(self.angle_y);
17656 __tmp.put_f32_le(self.distance);
17657 __tmp.put_f32_le(self.size_x);
17658 __tmp.put_f32_le(self.size_y);
17659 __tmp.put_u8(self.target_num);
17660 __tmp.put_u8(self.frame as u8);
17661 if matches!(version, MavlinkVersion::V2) {
17662 __tmp.put_f32_le(self.x);
17663 __tmp.put_f32_le(self.y);
17664 __tmp.put_f32_le(self.z);
17665 for val in &self.q {
17666 __tmp.put_f32_le(*val);
17667 }
17668 __tmp.put_u8(self.mavtype as u8);
17669 __tmp.put_u8(self.position_valid);
17670 let len = __tmp.len();
17671 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17672 } else {
17673 __tmp.len()
17674 }
17675 }
17676}
17677#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
17678#[doc = ""]
17679#[doc = "ID: 8"]
17680#[derive(Debug, Clone, PartialEq)]
17681#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17682#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17683#[cfg_attr(feature = "ts", derive(TS))]
17684#[cfg_attr(feature = "ts", ts(export))]
17685pub struct LINK_NODE_STATUS_DATA {
17686 #[doc = "Timestamp (time since system boot)."]
17687 pub timestamp: u64,
17688 #[doc = "Transmit rate"]
17689 pub tx_rate: u32,
17690 #[doc = "Receive rate"]
17691 pub rx_rate: u32,
17692 #[doc = "Messages sent"]
17693 pub messages_sent: u32,
17694 #[doc = "Messages received (estimated from counting seq)"]
17695 pub messages_received: u32,
17696 #[doc = "Messages lost (estimated from counting seq)"]
17697 pub messages_lost: u32,
17698 #[doc = "Number of bytes that could not be parsed correctly."]
17699 pub rx_parse_err: u16,
17700 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17701 pub tx_overflows: u16,
17702 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17703 pub rx_overflows: u16,
17704 #[doc = "Remaining free transmit buffer space"]
17705 pub tx_buf: u8,
17706 #[doc = "Remaining free receive buffer space"]
17707 pub rx_buf: u8,
17708}
17709impl LINK_NODE_STATUS_DATA {
17710 pub const ENCODED_LEN: usize = 36usize;
17711 pub const DEFAULT: Self = Self {
17712 timestamp: 0_u64,
17713 tx_rate: 0_u32,
17714 rx_rate: 0_u32,
17715 messages_sent: 0_u32,
17716 messages_received: 0_u32,
17717 messages_lost: 0_u32,
17718 rx_parse_err: 0_u16,
17719 tx_overflows: 0_u16,
17720 rx_overflows: 0_u16,
17721 tx_buf: 0_u8,
17722 rx_buf: 0_u8,
17723 };
17724 #[cfg(feature = "arbitrary")]
17725 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17726 use arbitrary::{Arbitrary, Unstructured};
17727 let mut buf = [0u8; 1024];
17728 rng.fill_bytes(&mut buf);
17729 let mut unstructured = Unstructured::new(&buf);
17730 Self::arbitrary(&mut unstructured).unwrap_or_default()
17731 }
17732}
17733impl Default for LINK_NODE_STATUS_DATA {
17734 fn default() -> Self {
17735 Self::DEFAULT.clone()
17736 }
17737}
17738impl MessageData for LINK_NODE_STATUS_DATA {
17739 type Message = MavMessage;
17740 const ID: u32 = 8u32;
17741 const NAME: &'static str = "LINK_NODE_STATUS";
17742 const EXTRA_CRC: u8 = 117u8;
17743 const ENCODED_LEN: usize = 36usize;
17744 fn deser(
17745 _version: MavlinkVersion,
17746 __input: &[u8],
17747 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17748 let avail_len = __input.len();
17749 let mut payload_buf = [0; Self::ENCODED_LEN];
17750 let mut buf = if avail_len < Self::ENCODED_LEN {
17751 payload_buf[0..avail_len].copy_from_slice(__input);
17752 Bytes::new(&payload_buf)
17753 } else {
17754 Bytes::new(__input)
17755 };
17756 let mut __struct = Self::default();
17757 __struct.timestamp = buf.get_u64_le();
17758 __struct.tx_rate = buf.get_u32_le();
17759 __struct.rx_rate = buf.get_u32_le();
17760 __struct.messages_sent = buf.get_u32_le();
17761 __struct.messages_received = buf.get_u32_le();
17762 __struct.messages_lost = buf.get_u32_le();
17763 __struct.rx_parse_err = buf.get_u16_le();
17764 __struct.tx_overflows = buf.get_u16_le();
17765 __struct.rx_overflows = buf.get_u16_le();
17766 __struct.tx_buf = buf.get_u8();
17767 __struct.rx_buf = buf.get_u8();
17768 Ok(__struct)
17769 }
17770 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17771 let mut __tmp = BytesMut::new(bytes);
17772 #[allow(clippy::absurd_extreme_comparisons)]
17773 #[allow(unused_comparisons)]
17774 if __tmp.remaining() < Self::ENCODED_LEN {
17775 panic!(
17776 "buffer is too small (need {} bytes, but got {})",
17777 Self::ENCODED_LEN,
17778 __tmp.remaining(),
17779 )
17780 }
17781 __tmp.put_u64_le(self.timestamp);
17782 __tmp.put_u32_le(self.tx_rate);
17783 __tmp.put_u32_le(self.rx_rate);
17784 __tmp.put_u32_le(self.messages_sent);
17785 __tmp.put_u32_le(self.messages_received);
17786 __tmp.put_u32_le(self.messages_lost);
17787 __tmp.put_u16_le(self.rx_parse_err);
17788 __tmp.put_u16_le(self.tx_overflows);
17789 __tmp.put_u16_le(self.rx_overflows);
17790 __tmp.put_u8(self.tx_buf);
17791 __tmp.put_u8(self.rx_buf);
17792 if matches!(version, MavlinkVersion::V2) {
17793 let len = __tmp.len();
17794 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17795 } else {
17796 __tmp.len()
17797 }
17798 }
17799}
17800#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17801#[doc = ""]
17802#[doc = "ID: 32"]
17803#[derive(Debug, Clone, PartialEq)]
17804#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17805#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17806#[cfg_attr(feature = "ts", derive(TS))]
17807#[cfg_attr(feature = "ts", ts(export))]
17808pub struct LOCAL_POSITION_NED_DATA {
17809 #[doc = "Timestamp (time since system boot)."]
17810 pub time_boot_ms: u32,
17811 #[doc = "X Position"]
17812 pub x: f32,
17813 #[doc = "Y Position"]
17814 pub y: f32,
17815 #[doc = "Z Position"]
17816 pub z: f32,
17817 #[doc = "X Speed"]
17818 pub vx: f32,
17819 #[doc = "Y Speed"]
17820 pub vy: f32,
17821 #[doc = "Z Speed"]
17822 pub vz: f32,
17823}
17824impl LOCAL_POSITION_NED_DATA {
17825 pub const ENCODED_LEN: usize = 28usize;
17826 pub const DEFAULT: Self = Self {
17827 time_boot_ms: 0_u32,
17828 x: 0.0_f32,
17829 y: 0.0_f32,
17830 z: 0.0_f32,
17831 vx: 0.0_f32,
17832 vy: 0.0_f32,
17833 vz: 0.0_f32,
17834 };
17835 #[cfg(feature = "arbitrary")]
17836 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17837 use arbitrary::{Arbitrary, Unstructured};
17838 let mut buf = [0u8; 1024];
17839 rng.fill_bytes(&mut buf);
17840 let mut unstructured = Unstructured::new(&buf);
17841 Self::arbitrary(&mut unstructured).unwrap_or_default()
17842 }
17843}
17844impl Default for LOCAL_POSITION_NED_DATA {
17845 fn default() -> Self {
17846 Self::DEFAULT.clone()
17847 }
17848}
17849impl MessageData for LOCAL_POSITION_NED_DATA {
17850 type Message = MavMessage;
17851 const ID: u32 = 32u32;
17852 const NAME: &'static str = "LOCAL_POSITION_NED";
17853 const EXTRA_CRC: u8 = 185u8;
17854 const ENCODED_LEN: usize = 28usize;
17855 fn deser(
17856 _version: MavlinkVersion,
17857 __input: &[u8],
17858 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17859 let avail_len = __input.len();
17860 let mut payload_buf = [0; Self::ENCODED_LEN];
17861 let mut buf = if avail_len < Self::ENCODED_LEN {
17862 payload_buf[0..avail_len].copy_from_slice(__input);
17863 Bytes::new(&payload_buf)
17864 } else {
17865 Bytes::new(__input)
17866 };
17867 let mut __struct = Self::default();
17868 __struct.time_boot_ms = buf.get_u32_le();
17869 __struct.x = buf.get_f32_le();
17870 __struct.y = buf.get_f32_le();
17871 __struct.z = buf.get_f32_le();
17872 __struct.vx = buf.get_f32_le();
17873 __struct.vy = buf.get_f32_le();
17874 __struct.vz = buf.get_f32_le();
17875 Ok(__struct)
17876 }
17877 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17878 let mut __tmp = BytesMut::new(bytes);
17879 #[allow(clippy::absurd_extreme_comparisons)]
17880 #[allow(unused_comparisons)]
17881 if __tmp.remaining() < Self::ENCODED_LEN {
17882 panic!(
17883 "buffer is too small (need {} bytes, but got {})",
17884 Self::ENCODED_LEN,
17885 __tmp.remaining(),
17886 )
17887 }
17888 __tmp.put_u32_le(self.time_boot_ms);
17889 __tmp.put_f32_le(self.x);
17890 __tmp.put_f32_le(self.y);
17891 __tmp.put_f32_le(self.z);
17892 __tmp.put_f32_le(self.vx);
17893 __tmp.put_f32_le(self.vy);
17894 __tmp.put_f32_le(self.vz);
17895 if matches!(version, MavlinkVersion::V2) {
17896 let len = __tmp.len();
17897 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17898 } else {
17899 __tmp.len()
17900 }
17901 }
17902}
17903#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17904#[doc = ""]
17905#[doc = "ID: 64"]
17906#[derive(Debug, Clone, PartialEq)]
17907#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17908#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17909#[cfg_attr(feature = "ts", derive(TS))]
17910#[cfg_attr(feature = "ts", ts(export))]
17911pub struct LOCAL_POSITION_NED_COV_DATA {
17912 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17913 pub time_usec: u64,
17914 #[doc = "X Position"]
17915 pub x: f32,
17916 #[doc = "Y Position"]
17917 pub y: f32,
17918 #[doc = "Z Position"]
17919 pub z: f32,
17920 #[doc = "X Speed"]
17921 pub vx: f32,
17922 #[doc = "Y Speed"]
17923 pub vy: f32,
17924 #[doc = "Z Speed"]
17925 pub vz: f32,
17926 #[doc = "X Acceleration"]
17927 pub ax: f32,
17928 #[doc = "Y Acceleration"]
17929 pub ay: f32,
17930 #[doc = "Z Acceleration"]
17931 pub az: f32,
17932 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
17933 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17934 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17935 pub covariance: [f32; 45],
17936 #[doc = "Class id of the estimator this estimate originated from."]
17937 pub estimator_type: MavEstimatorType,
17938}
17939impl LOCAL_POSITION_NED_COV_DATA {
17940 pub const ENCODED_LEN: usize = 225usize;
17941 pub const DEFAULT: Self = Self {
17942 time_usec: 0_u64,
17943 x: 0.0_f32,
17944 y: 0.0_f32,
17945 z: 0.0_f32,
17946 vx: 0.0_f32,
17947 vy: 0.0_f32,
17948 vz: 0.0_f32,
17949 ax: 0.0_f32,
17950 ay: 0.0_f32,
17951 az: 0.0_f32,
17952 covariance: [0.0_f32; 45usize],
17953 estimator_type: MavEstimatorType::DEFAULT,
17954 };
17955 #[cfg(feature = "arbitrary")]
17956 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17957 use arbitrary::{Arbitrary, Unstructured};
17958 let mut buf = [0u8; 1024];
17959 rng.fill_bytes(&mut buf);
17960 let mut unstructured = Unstructured::new(&buf);
17961 Self::arbitrary(&mut unstructured).unwrap_or_default()
17962 }
17963}
17964impl Default for LOCAL_POSITION_NED_COV_DATA {
17965 fn default() -> Self {
17966 Self::DEFAULT.clone()
17967 }
17968}
17969impl MessageData for LOCAL_POSITION_NED_COV_DATA {
17970 type Message = MavMessage;
17971 const ID: u32 = 64u32;
17972 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
17973 const EXTRA_CRC: u8 = 191u8;
17974 const ENCODED_LEN: usize = 225usize;
17975 fn deser(
17976 _version: MavlinkVersion,
17977 __input: &[u8],
17978 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17979 let avail_len = __input.len();
17980 let mut payload_buf = [0; Self::ENCODED_LEN];
17981 let mut buf = if avail_len < Self::ENCODED_LEN {
17982 payload_buf[0..avail_len].copy_from_slice(__input);
17983 Bytes::new(&payload_buf)
17984 } else {
17985 Bytes::new(__input)
17986 };
17987 let mut __struct = Self::default();
17988 __struct.time_usec = buf.get_u64_le();
17989 __struct.x = buf.get_f32_le();
17990 __struct.y = buf.get_f32_le();
17991 __struct.z = buf.get_f32_le();
17992 __struct.vx = buf.get_f32_le();
17993 __struct.vy = buf.get_f32_le();
17994 __struct.vz = buf.get_f32_le();
17995 __struct.ax = buf.get_f32_le();
17996 __struct.ay = buf.get_f32_le();
17997 __struct.az = buf.get_f32_le();
17998 for v in &mut __struct.covariance {
17999 let val = buf.get_f32_le();
18000 *v = val;
18001 }
18002 let tmp = buf.get_u8();
18003 __struct.estimator_type =
18004 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18005 enum_type: "MavEstimatorType",
18006 value: tmp as u64,
18007 })?;
18008 Ok(__struct)
18009 }
18010 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18011 let mut __tmp = BytesMut::new(bytes);
18012 #[allow(clippy::absurd_extreme_comparisons)]
18013 #[allow(unused_comparisons)]
18014 if __tmp.remaining() < Self::ENCODED_LEN {
18015 panic!(
18016 "buffer is too small (need {} bytes, but got {})",
18017 Self::ENCODED_LEN,
18018 __tmp.remaining(),
18019 )
18020 }
18021 __tmp.put_u64_le(self.time_usec);
18022 __tmp.put_f32_le(self.x);
18023 __tmp.put_f32_le(self.y);
18024 __tmp.put_f32_le(self.z);
18025 __tmp.put_f32_le(self.vx);
18026 __tmp.put_f32_le(self.vy);
18027 __tmp.put_f32_le(self.vz);
18028 __tmp.put_f32_le(self.ax);
18029 __tmp.put_f32_le(self.ay);
18030 __tmp.put_f32_le(self.az);
18031 for val in &self.covariance {
18032 __tmp.put_f32_le(*val);
18033 }
18034 __tmp.put_u8(self.estimator_type as u8);
18035 if matches!(version, MavlinkVersion::V2) {
18036 let len = __tmp.len();
18037 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18038 } else {
18039 __tmp.len()
18040 }
18041 }
18042}
18043#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18044#[doc = ""]
18045#[doc = "ID: 89"]
18046#[derive(Debug, Clone, PartialEq)]
18047#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18048#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18049#[cfg_attr(feature = "ts", derive(TS))]
18050#[cfg_attr(feature = "ts", ts(export))]
18051pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18052 #[doc = "Timestamp (time since system boot)."]
18053 pub time_boot_ms: u32,
18054 #[doc = "X Position"]
18055 pub x: f32,
18056 #[doc = "Y Position"]
18057 pub y: f32,
18058 #[doc = "Z Position"]
18059 pub z: f32,
18060 #[doc = "Roll"]
18061 pub roll: f32,
18062 #[doc = "Pitch"]
18063 pub pitch: f32,
18064 #[doc = "Yaw"]
18065 pub yaw: f32,
18066}
18067impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18068 pub const ENCODED_LEN: usize = 28usize;
18069 pub const DEFAULT: Self = Self {
18070 time_boot_ms: 0_u32,
18071 x: 0.0_f32,
18072 y: 0.0_f32,
18073 z: 0.0_f32,
18074 roll: 0.0_f32,
18075 pitch: 0.0_f32,
18076 yaw: 0.0_f32,
18077 };
18078 #[cfg(feature = "arbitrary")]
18079 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18080 use arbitrary::{Arbitrary, Unstructured};
18081 let mut buf = [0u8; 1024];
18082 rng.fill_bytes(&mut buf);
18083 let mut unstructured = Unstructured::new(&buf);
18084 Self::arbitrary(&mut unstructured).unwrap_or_default()
18085 }
18086}
18087impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18088 fn default() -> Self {
18089 Self::DEFAULT.clone()
18090 }
18091}
18092impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18093 type Message = MavMessage;
18094 const ID: u32 = 89u32;
18095 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
18096 const EXTRA_CRC: u8 = 231u8;
18097 const ENCODED_LEN: usize = 28usize;
18098 fn deser(
18099 _version: MavlinkVersion,
18100 __input: &[u8],
18101 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18102 let avail_len = __input.len();
18103 let mut payload_buf = [0; Self::ENCODED_LEN];
18104 let mut buf = if avail_len < Self::ENCODED_LEN {
18105 payload_buf[0..avail_len].copy_from_slice(__input);
18106 Bytes::new(&payload_buf)
18107 } else {
18108 Bytes::new(__input)
18109 };
18110 let mut __struct = Self::default();
18111 __struct.time_boot_ms = buf.get_u32_le();
18112 __struct.x = buf.get_f32_le();
18113 __struct.y = buf.get_f32_le();
18114 __struct.z = buf.get_f32_le();
18115 __struct.roll = buf.get_f32_le();
18116 __struct.pitch = buf.get_f32_le();
18117 __struct.yaw = buf.get_f32_le();
18118 Ok(__struct)
18119 }
18120 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18121 let mut __tmp = BytesMut::new(bytes);
18122 #[allow(clippy::absurd_extreme_comparisons)]
18123 #[allow(unused_comparisons)]
18124 if __tmp.remaining() < Self::ENCODED_LEN {
18125 panic!(
18126 "buffer is too small (need {} bytes, but got {})",
18127 Self::ENCODED_LEN,
18128 __tmp.remaining(),
18129 )
18130 }
18131 __tmp.put_u32_le(self.time_boot_ms);
18132 __tmp.put_f32_le(self.x);
18133 __tmp.put_f32_le(self.y);
18134 __tmp.put_f32_le(self.z);
18135 __tmp.put_f32_le(self.roll);
18136 __tmp.put_f32_le(self.pitch);
18137 __tmp.put_f32_le(self.yaw);
18138 if matches!(version, MavlinkVersion::V2) {
18139 let len = __tmp.len();
18140 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18141 } else {
18142 __tmp.len()
18143 }
18144 }
18145}
18146#[doc = "An ack for a LOGGING_DATA_ACKED message."]
18147#[doc = ""]
18148#[doc = "ID: 268"]
18149#[derive(Debug, Clone, PartialEq)]
18150#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18151#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18152#[cfg_attr(feature = "ts", derive(TS))]
18153#[cfg_attr(feature = "ts", ts(export))]
18154pub struct LOGGING_ACK_DATA {
18155 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
18156 pub sequence: u16,
18157 #[doc = "system ID of the target"]
18158 pub target_system: u8,
18159 #[doc = "component ID of the target"]
18160 pub target_component: u8,
18161}
18162impl LOGGING_ACK_DATA {
18163 pub const ENCODED_LEN: usize = 4usize;
18164 pub const DEFAULT: Self = Self {
18165 sequence: 0_u16,
18166 target_system: 0_u8,
18167 target_component: 0_u8,
18168 };
18169 #[cfg(feature = "arbitrary")]
18170 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18171 use arbitrary::{Arbitrary, Unstructured};
18172 let mut buf = [0u8; 1024];
18173 rng.fill_bytes(&mut buf);
18174 let mut unstructured = Unstructured::new(&buf);
18175 Self::arbitrary(&mut unstructured).unwrap_or_default()
18176 }
18177}
18178impl Default for LOGGING_ACK_DATA {
18179 fn default() -> Self {
18180 Self::DEFAULT.clone()
18181 }
18182}
18183impl MessageData for LOGGING_ACK_DATA {
18184 type Message = MavMessage;
18185 const ID: u32 = 268u32;
18186 const NAME: &'static str = "LOGGING_ACK";
18187 const EXTRA_CRC: u8 = 14u8;
18188 const ENCODED_LEN: usize = 4usize;
18189 fn deser(
18190 _version: MavlinkVersion,
18191 __input: &[u8],
18192 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18193 let avail_len = __input.len();
18194 let mut payload_buf = [0; Self::ENCODED_LEN];
18195 let mut buf = if avail_len < Self::ENCODED_LEN {
18196 payload_buf[0..avail_len].copy_from_slice(__input);
18197 Bytes::new(&payload_buf)
18198 } else {
18199 Bytes::new(__input)
18200 };
18201 let mut __struct = Self::default();
18202 __struct.sequence = buf.get_u16_le();
18203 __struct.target_system = buf.get_u8();
18204 __struct.target_component = buf.get_u8();
18205 Ok(__struct)
18206 }
18207 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18208 let mut __tmp = BytesMut::new(bytes);
18209 #[allow(clippy::absurd_extreme_comparisons)]
18210 #[allow(unused_comparisons)]
18211 if __tmp.remaining() < Self::ENCODED_LEN {
18212 panic!(
18213 "buffer is too small (need {} bytes, but got {})",
18214 Self::ENCODED_LEN,
18215 __tmp.remaining(),
18216 )
18217 }
18218 __tmp.put_u16_le(self.sequence);
18219 __tmp.put_u8(self.target_system);
18220 __tmp.put_u8(self.target_component);
18221 if matches!(version, MavlinkVersion::V2) {
18222 let len = __tmp.len();
18223 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18224 } else {
18225 __tmp.len()
18226 }
18227 }
18228}
18229#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
18230#[doc = ""]
18231#[doc = "ID: 266"]
18232#[derive(Debug, Clone, PartialEq)]
18233#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18234#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18235#[cfg_attr(feature = "ts", derive(TS))]
18236#[cfg_attr(feature = "ts", ts(export))]
18237pub struct LOGGING_DATA_DATA {
18238 #[doc = "sequence number (can wrap)"]
18239 pub sequence: u16,
18240 #[doc = "system ID of the target"]
18241 pub target_system: u8,
18242 #[doc = "component ID of the target"]
18243 pub target_component: u8,
18244 #[doc = "data length"]
18245 pub length: u8,
18246 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18247 pub first_message_offset: u8,
18248 #[doc = "logged data"]
18249 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18250 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18251 pub data: [u8; 249],
18252}
18253impl LOGGING_DATA_DATA {
18254 pub const ENCODED_LEN: usize = 255usize;
18255 pub const DEFAULT: Self = Self {
18256 sequence: 0_u16,
18257 target_system: 0_u8,
18258 target_component: 0_u8,
18259 length: 0_u8,
18260 first_message_offset: 0_u8,
18261 data: [0_u8; 249usize],
18262 };
18263 #[cfg(feature = "arbitrary")]
18264 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18265 use arbitrary::{Arbitrary, Unstructured};
18266 let mut buf = [0u8; 1024];
18267 rng.fill_bytes(&mut buf);
18268 let mut unstructured = Unstructured::new(&buf);
18269 Self::arbitrary(&mut unstructured).unwrap_or_default()
18270 }
18271}
18272impl Default for LOGGING_DATA_DATA {
18273 fn default() -> Self {
18274 Self::DEFAULT.clone()
18275 }
18276}
18277impl MessageData for LOGGING_DATA_DATA {
18278 type Message = MavMessage;
18279 const ID: u32 = 266u32;
18280 const NAME: &'static str = "LOGGING_DATA";
18281 const EXTRA_CRC: u8 = 193u8;
18282 const ENCODED_LEN: usize = 255usize;
18283 fn deser(
18284 _version: MavlinkVersion,
18285 __input: &[u8],
18286 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18287 let avail_len = __input.len();
18288 let mut payload_buf = [0; Self::ENCODED_LEN];
18289 let mut buf = if avail_len < Self::ENCODED_LEN {
18290 payload_buf[0..avail_len].copy_from_slice(__input);
18291 Bytes::new(&payload_buf)
18292 } else {
18293 Bytes::new(__input)
18294 };
18295 let mut __struct = Self::default();
18296 __struct.sequence = buf.get_u16_le();
18297 __struct.target_system = buf.get_u8();
18298 __struct.target_component = buf.get_u8();
18299 __struct.length = buf.get_u8();
18300 __struct.first_message_offset = buf.get_u8();
18301 for v in &mut __struct.data {
18302 let val = buf.get_u8();
18303 *v = val;
18304 }
18305 Ok(__struct)
18306 }
18307 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18308 let mut __tmp = BytesMut::new(bytes);
18309 #[allow(clippy::absurd_extreme_comparisons)]
18310 #[allow(unused_comparisons)]
18311 if __tmp.remaining() < Self::ENCODED_LEN {
18312 panic!(
18313 "buffer is too small (need {} bytes, but got {})",
18314 Self::ENCODED_LEN,
18315 __tmp.remaining(),
18316 )
18317 }
18318 __tmp.put_u16_le(self.sequence);
18319 __tmp.put_u8(self.target_system);
18320 __tmp.put_u8(self.target_component);
18321 __tmp.put_u8(self.length);
18322 __tmp.put_u8(self.first_message_offset);
18323 for val in &self.data {
18324 __tmp.put_u8(*val);
18325 }
18326 if matches!(version, MavlinkVersion::V2) {
18327 let len = __tmp.len();
18328 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18329 } else {
18330 __tmp.len()
18331 }
18332 }
18333}
18334#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
18335#[doc = ""]
18336#[doc = "ID: 267"]
18337#[derive(Debug, Clone, PartialEq)]
18338#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18340#[cfg_attr(feature = "ts", derive(TS))]
18341#[cfg_attr(feature = "ts", ts(export))]
18342pub struct LOGGING_DATA_ACKED_DATA {
18343 #[doc = "sequence number (can wrap)"]
18344 pub sequence: u16,
18345 #[doc = "system ID of the target"]
18346 pub target_system: u8,
18347 #[doc = "component ID of the target"]
18348 pub target_component: u8,
18349 #[doc = "data length"]
18350 pub length: u8,
18351 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18352 pub first_message_offset: u8,
18353 #[doc = "logged data"]
18354 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18355 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18356 pub data: [u8; 249],
18357}
18358impl LOGGING_DATA_ACKED_DATA {
18359 pub const ENCODED_LEN: usize = 255usize;
18360 pub const DEFAULT: Self = Self {
18361 sequence: 0_u16,
18362 target_system: 0_u8,
18363 target_component: 0_u8,
18364 length: 0_u8,
18365 first_message_offset: 0_u8,
18366 data: [0_u8; 249usize],
18367 };
18368 #[cfg(feature = "arbitrary")]
18369 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18370 use arbitrary::{Arbitrary, Unstructured};
18371 let mut buf = [0u8; 1024];
18372 rng.fill_bytes(&mut buf);
18373 let mut unstructured = Unstructured::new(&buf);
18374 Self::arbitrary(&mut unstructured).unwrap_or_default()
18375 }
18376}
18377impl Default for LOGGING_DATA_ACKED_DATA {
18378 fn default() -> Self {
18379 Self::DEFAULT.clone()
18380 }
18381}
18382impl MessageData for LOGGING_DATA_ACKED_DATA {
18383 type Message = MavMessage;
18384 const ID: u32 = 267u32;
18385 const NAME: &'static str = "LOGGING_DATA_ACKED";
18386 const EXTRA_CRC: u8 = 35u8;
18387 const ENCODED_LEN: usize = 255usize;
18388 fn deser(
18389 _version: MavlinkVersion,
18390 __input: &[u8],
18391 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18392 let avail_len = __input.len();
18393 let mut payload_buf = [0; Self::ENCODED_LEN];
18394 let mut buf = if avail_len < Self::ENCODED_LEN {
18395 payload_buf[0..avail_len].copy_from_slice(__input);
18396 Bytes::new(&payload_buf)
18397 } else {
18398 Bytes::new(__input)
18399 };
18400 let mut __struct = Self::default();
18401 __struct.sequence = buf.get_u16_le();
18402 __struct.target_system = buf.get_u8();
18403 __struct.target_component = buf.get_u8();
18404 __struct.length = buf.get_u8();
18405 __struct.first_message_offset = buf.get_u8();
18406 for v in &mut __struct.data {
18407 let val = buf.get_u8();
18408 *v = val;
18409 }
18410 Ok(__struct)
18411 }
18412 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18413 let mut __tmp = BytesMut::new(bytes);
18414 #[allow(clippy::absurd_extreme_comparisons)]
18415 #[allow(unused_comparisons)]
18416 if __tmp.remaining() < Self::ENCODED_LEN {
18417 panic!(
18418 "buffer is too small (need {} bytes, but got {})",
18419 Self::ENCODED_LEN,
18420 __tmp.remaining(),
18421 )
18422 }
18423 __tmp.put_u16_le(self.sequence);
18424 __tmp.put_u8(self.target_system);
18425 __tmp.put_u8(self.target_component);
18426 __tmp.put_u8(self.length);
18427 __tmp.put_u8(self.first_message_offset);
18428 for val in &self.data {
18429 __tmp.put_u8(*val);
18430 }
18431 if matches!(version, MavlinkVersion::V2) {
18432 let len = __tmp.len();
18433 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18434 } else {
18435 __tmp.len()
18436 }
18437 }
18438}
18439#[doc = "Reply to LOG_REQUEST_DATA."]
18440#[doc = ""]
18441#[doc = "ID: 120"]
18442#[derive(Debug, Clone, PartialEq)]
18443#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18444#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18445#[cfg_attr(feature = "ts", derive(TS))]
18446#[cfg_attr(feature = "ts", ts(export))]
18447pub struct LOG_DATA_DATA {
18448 #[doc = "Offset into the log"]
18449 pub ofs: u32,
18450 #[doc = "Log id (from LOG_ENTRY reply)"]
18451 pub id: u16,
18452 #[doc = "Number of bytes (zero for end of log)"]
18453 pub count: u8,
18454 #[doc = "log data"]
18455 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18456 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18457 pub data: [u8; 90],
18458}
18459impl LOG_DATA_DATA {
18460 pub const ENCODED_LEN: usize = 97usize;
18461 pub const DEFAULT: Self = Self {
18462 ofs: 0_u32,
18463 id: 0_u16,
18464 count: 0_u8,
18465 data: [0_u8; 90usize],
18466 };
18467 #[cfg(feature = "arbitrary")]
18468 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18469 use arbitrary::{Arbitrary, Unstructured};
18470 let mut buf = [0u8; 1024];
18471 rng.fill_bytes(&mut buf);
18472 let mut unstructured = Unstructured::new(&buf);
18473 Self::arbitrary(&mut unstructured).unwrap_or_default()
18474 }
18475}
18476impl Default for LOG_DATA_DATA {
18477 fn default() -> Self {
18478 Self::DEFAULT.clone()
18479 }
18480}
18481impl MessageData for LOG_DATA_DATA {
18482 type Message = MavMessage;
18483 const ID: u32 = 120u32;
18484 const NAME: &'static str = "LOG_DATA";
18485 const EXTRA_CRC: u8 = 134u8;
18486 const ENCODED_LEN: usize = 97usize;
18487 fn deser(
18488 _version: MavlinkVersion,
18489 __input: &[u8],
18490 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18491 let avail_len = __input.len();
18492 let mut payload_buf = [0; Self::ENCODED_LEN];
18493 let mut buf = if avail_len < Self::ENCODED_LEN {
18494 payload_buf[0..avail_len].copy_from_slice(__input);
18495 Bytes::new(&payload_buf)
18496 } else {
18497 Bytes::new(__input)
18498 };
18499 let mut __struct = Self::default();
18500 __struct.ofs = buf.get_u32_le();
18501 __struct.id = buf.get_u16_le();
18502 __struct.count = buf.get_u8();
18503 for v in &mut __struct.data {
18504 let val = buf.get_u8();
18505 *v = val;
18506 }
18507 Ok(__struct)
18508 }
18509 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18510 let mut __tmp = BytesMut::new(bytes);
18511 #[allow(clippy::absurd_extreme_comparisons)]
18512 #[allow(unused_comparisons)]
18513 if __tmp.remaining() < Self::ENCODED_LEN {
18514 panic!(
18515 "buffer is too small (need {} bytes, but got {})",
18516 Self::ENCODED_LEN,
18517 __tmp.remaining(),
18518 )
18519 }
18520 __tmp.put_u32_le(self.ofs);
18521 __tmp.put_u16_le(self.id);
18522 __tmp.put_u8(self.count);
18523 for val in &self.data {
18524 __tmp.put_u8(*val);
18525 }
18526 if matches!(version, MavlinkVersion::V2) {
18527 let len = __tmp.len();
18528 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18529 } else {
18530 __tmp.len()
18531 }
18532 }
18533}
18534#[doc = "Reply to LOG_REQUEST_LIST."]
18535#[doc = ""]
18536#[doc = "ID: 118"]
18537#[derive(Debug, Clone, PartialEq)]
18538#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18539#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18540#[cfg_attr(feature = "ts", derive(TS))]
18541#[cfg_attr(feature = "ts", ts(export))]
18542pub struct LOG_ENTRY_DATA {
18543 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
18544 pub time_utc: u32,
18545 #[doc = "Size of the log (may be approximate)"]
18546 pub size: u32,
18547 #[doc = "Log id"]
18548 pub id: u16,
18549 #[doc = "Total number of logs"]
18550 pub num_logs: u16,
18551 #[doc = "High log number"]
18552 pub last_log_num: u16,
18553}
18554impl LOG_ENTRY_DATA {
18555 pub const ENCODED_LEN: usize = 14usize;
18556 pub const DEFAULT: Self = Self {
18557 time_utc: 0_u32,
18558 size: 0_u32,
18559 id: 0_u16,
18560 num_logs: 0_u16,
18561 last_log_num: 0_u16,
18562 };
18563 #[cfg(feature = "arbitrary")]
18564 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18565 use arbitrary::{Arbitrary, Unstructured};
18566 let mut buf = [0u8; 1024];
18567 rng.fill_bytes(&mut buf);
18568 let mut unstructured = Unstructured::new(&buf);
18569 Self::arbitrary(&mut unstructured).unwrap_or_default()
18570 }
18571}
18572impl Default for LOG_ENTRY_DATA {
18573 fn default() -> Self {
18574 Self::DEFAULT.clone()
18575 }
18576}
18577impl MessageData for LOG_ENTRY_DATA {
18578 type Message = MavMessage;
18579 const ID: u32 = 118u32;
18580 const NAME: &'static str = "LOG_ENTRY";
18581 const EXTRA_CRC: u8 = 56u8;
18582 const ENCODED_LEN: usize = 14usize;
18583 fn deser(
18584 _version: MavlinkVersion,
18585 __input: &[u8],
18586 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18587 let avail_len = __input.len();
18588 let mut payload_buf = [0; Self::ENCODED_LEN];
18589 let mut buf = if avail_len < Self::ENCODED_LEN {
18590 payload_buf[0..avail_len].copy_from_slice(__input);
18591 Bytes::new(&payload_buf)
18592 } else {
18593 Bytes::new(__input)
18594 };
18595 let mut __struct = Self::default();
18596 __struct.time_utc = buf.get_u32_le();
18597 __struct.size = buf.get_u32_le();
18598 __struct.id = buf.get_u16_le();
18599 __struct.num_logs = buf.get_u16_le();
18600 __struct.last_log_num = buf.get_u16_le();
18601 Ok(__struct)
18602 }
18603 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18604 let mut __tmp = BytesMut::new(bytes);
18605 #[allow(clippy::absurd_extreme_comparisons)]
18606 #[allow(unused_comparisons)]
18607 if __tmp.remaining() < Self::ENCODED_LEN {
18608 panic!(
18609 "buffer is too small (need {} bytes, but got {})",
18610 Self::ENCODED_LEN,
18611 __tmp.remaining(),
18612 )
18613 }
18614 __tmp.put_u32_le(self.time_utc);
18615 __tmp.put_u32_le(self.size);
18616 __tmp.put_u16_le(self.id);
18617 __tmp.put_u16_le(self.num_logs);
18618 __tmp.put_u16_le(self.last_log_num);
18619 if matches!(version, MavlinkVersion::V2) {
18620 let len = __tmp.len();
18621 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18622 } else {
18623 __tmp.len()
18624 }
18625 }
18626}
18627#[doc = "Erase all logs."]
18628#[doc = ""]
18629#[doc = "ID: 121"]
18630#[derive(Debug, Clone, PartialEq)]
18631#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18632#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18633#[cfg_attr(feature = "ts", derive(TS))]
18634#[cfg_attr(feature = "ts", ts(export))]
18635pub struct LOG_ERASE_DATA {
18636 #[doc = "System ID"]
18637 pub target_system: u8,
18638 #[doc = "Component ID"]
18639 pub target_component: u8,
18640}
18641impl LOG_ERASE_DATA {
18642 pub const ENCODED_LEN: usize = 2usize;
18643 pub const DEFAULT: Self = Self {
18644 target_system: 0_u8,
18645 target_component: 0_u8,
18646 };
18647 #[cfg(feature = "arbitrary")]
18648 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18649 use arbitrary::{Arbitrary, Unstructured};
18650 let mut buf = [0u8; 1024];
18651 rng.fill_bytes(&mut buf);
18652 let mut unstructured = Unstructured::new(&buf);
18653 Self::arbitrary(&mut unstructured).unwrap_or_default()
18654 }
18655}
18656impl Default for LOG_ERASE_DATA {
18657 fn default() -> Self {
18658 Self::DEFAULT.clone()
18659 }
18660}
18661impl MessageData for LOG_ERASE_DATA {
18662 type Message = MavMessage;
18663 const ID: u32 = 121u32;
18664 const NAME: &'static str = "LOG_ERASE";
18665 const EXTRA_CRC: u8 = 237u8;
18666 const ENCODED_LEN: usize = 2usize;
18667 fn deser(
18668 _version: MavlinkVersion,
18669 __input: &[u8],
18670 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18671 let avail_len = __input.len();
18672 let mut payload_buf = [0; Self::ENCODED_LEN];
18673 let mut buf = if avail_len < Self::ENCODED_LEN {
18674 payload_buf[0..avail_len].copy_from_slice(__input);
18675 Bytes::new(&payload_buf)
18676 } else {
18677 Bytes::new(__input)
18678 };
18679 let mut __struct = Self::default();
18680 __struct.target_system = buf.get_u8();
18681 __struct.target_component = buf.get_u8();
18682 Ok(__struct)
18683 }
18684 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18685 let mut __tmp = BytesMut::new(bytes);
18686 #[allow(clippy::absurd_extreme_comparisons)]
18687 #[allow(unused_comparisons)]
18688 if __tmp.remaining() < Self::ENCODED_LEN {
18689 panic!(
18690 "buffer is too small (need {} bytes, but got {})",
18691 Self::ENCODED_LEN,
18692 __tmp.remaining(),
18693 )
18694 }
18695 __tmp.put_u8(self.target_system);
18696 __tmp.put_u8(self.target_component);
18697 if matches!(version, MavlinkVersion::V2) {
18698 let len = __tmp.len();
18699 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18700 } else {
18701 __tmp.len()
18702 }
18703 }
18704}
18705#[doc = "Request a chunk of a log."]
18706#[doc = ""]
18707#[doc = "ID: 119"]
18708#[derive(Debug, Clone, PartialEq)]
18709#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18710#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18711#[cfg_attr(feature = "ts", derive(TS))]
18712#[cfg_attr(feature = "ts", ts(export))]
18713pub struct LOG_REQUEST_DATA_DATA {
18714 #[doc = "Offset into the log"]
18715 pub ofs: u32,
18716 #[doc = "Number of bytes"]
18717 pub count: u32,
18718 #[doc = "Log id (from LOG_ENTRY reply)"]
18719 pub id: u16,
18720 #[doc = "System ID"]
18721 pub target_system: u8,
18722 #[doc = "Component ID"]
18723 pub target_component: u8,
18724}
18725impl LOG_REQUEST_DATA_DATA {
18726 pub const ENCODED_LEN: usize = 12usize;
18727 pub const DEFAULT: Self = Self {
18728 ofs: 0_u32,
18729 count: 0_u32,
18730 id: 0_u16,
18731 target_system: 0_u8,
18732 target_component: 0_u8,
18733 };
18734 #[cfg(feature = "arbitrary")]
18735 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18736 use arbitrary::{Arbitrary, Unstructured};
18737 let mut buf = [0u8; 1024];
18738 rng.fill_bytes(&mut buf);
18739 let mut unstructured = Unstructured::new(&buf);
18740 Self::arbitrary(&mut unstructured).unwrap_or_default()
18741 }
18742}
18743impl Default for LOG_REQUEST_DATA_DATA {
18744 fn default() -> Self {
18745 Self::DEFAULT.clone()
18746 }
18747}
18748impl MessageData for LOG_REQUEST_DATA_DATA {
18749 type Message = MavMessage;
18750 const ID: u32 = 119u32;
18751 const NAME: &'static str = "LOG_REQUEST_DATA";
18752 const EXTRA_CRC: u8 = 116u8;
18753 const ENCODED_LEN: usize = 12usize;
18754 fn deser(
18755 _version: MavlinkVersion,
18756 __input: &[u8],
18757 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18758 let avail_len = __input.len();
18759 let mut payload_buf = [0; Self::ENCODED_LEN];
18760 let mut buf = if avail_len < Self::ENCODED_LEN {
18761 payload_buf[0..avail_len].copy_from_slice(__input);
18762 Bytes::new(&payload_buf)
18763 } else {
18764 Bytes::new(__input)
18765 };
18766 let mut __struct = Self::default();
18767 __struct.ofs = buf.get_u32_le();
18768 __struct.count = buf.get_u32_le();
18769 __struct.id = buf.get_u16_le();
18770 __struct.target_system = buf.get_u8();
18771 __struct.target_component = buf.get_u8();
18772 Ok(__struct)
18773 }
18774 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18775 let mut __tmp = BytesMut::new(bytes);
18776 #[allow(clippy::absurd_extreme_comparisons)]
18777 #[allow(unused_comparisons)]
18778 if __tmp.remaining() < Self::ENCODED_LEN {
18779 panic!(
18780 "buffer is too small (need {} bytes, but got {})",
18781 Self::ENCODED_LEN,
18782 __tmp.remaining(),
18783 )
18784 }
18785 __tmp.put_u32_le(self.ofs);
18786 __tmp.put_u32_le(self.count);
18787 __tmp.put_u16_le(self.id);
18788 __tmp.put_u8(self.target_system);
18789 __tmp.put_u8(self.target_component);
18790 if matches!(version, MavlinkVersion::V2) {
18791 let len = __tmp.len();
18792 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18793 } else {
18794 __tmp.len()
18795 }
18796 }
18797}
18798#[doc = "Stop log transfer and resume normal logging."]
18799#[doc = ""]
18800#[doc = "ID: 122"]
18801#[derive(Debug, Clone, PartialEq)]
18802#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18803#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18804#[cfg_attr(feature = "ts", derive(TS))]
18805#[cfg_attr(feature = "ts", ts(export))]
18806pub struct LOG_REQUEST_END_DATA {
18807 #[doc = "System ID"]
18808 pub target_system: u8,
18809 #[doc = "Component ID"]
18810 pub target_component: u8,
18811}
18812impl LOG_REQUEST_END_DATA {
18813 pub const ENCODED_LEN: usize = 2usize;
18814 pub const DEFAULT: Self = Self {
18815 target_system: 0_u8,
18816 target_component: 0_u8,
18817 };
18818 #[cfg(feature = "arbitrary")]
18819 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18820 use arbitrary::{Arbitrary, Unstructured};
18821 let mut buf = [0u8; 1024];
18822 rng.fill_bytes(&mut buf);
18823 let mut unstructured = Unstructured::new(&buf);
18824 Self::arbitrary(&mut unstructured).unwrap_or_default()
18825 }
18826}
18827impl Default for LOG_REQUEST_END_DATA {
18828 fn default() -> Self {
18829 Self::DEFAULT.clone()
18830 }
18831}
18832impl MessageData for LOG_REQUEST_END_DATA {
18833 type Message = MavMessage;
18834 const ID: u32 = 122u32;
18835 const NAME: &'static str = "LOG_REQUEST_END";
18836 const EXTRA_CRC: u8 = 203u8;
18837 const ENCODED_LEN: usize = 2usize;
18838 fn deser(
18839 _version: MavlinkVersion,
18840 __input: &[u8],
18841 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18842 let avail_len = __input.len();
18843 let mut payload_buf = [0; Self::ENCODED_LEN];
18844 let mut buf = if avail_len < Self::ENCODED_LEN {
18845 payload_buf[0..avail_len].copy_from_slice(__input);
18846 Bytes::new(&payload_buf)
18847 } else {
18848 Bytes::new(__input)
18849 };
18850 let mut __struct = Self::default();
18851 __struct.target_system = buf.get_u8();
18852 __struct.target_component = buf.get_u8();
18853 Ok(__struct)
18854 }
18855 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18856 let mut __tmp = BytesMut::new(bytes);
18857 #[allow(clippy::absurd_extreme_comparisons)]
18858 #[allow(unused_comparisons)]
18859 if __tmp.remaining() < Self::ENCODED_LEN {
18860 panic!(
18861 "buffer is too small (need {} bytes, but got {})",
18862 Self::ENCODED_LEN,
18863 __tmp.remaining(),
18864 )
18865 }
18866 __tmp.put_u8(self.target_system);
18867 __tmp.put_u8(self.target_component);
18868 if matches!(version, MavlinkVersion::V2) {
18869 let len = __tmp.len();
18870 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18871 } else {
18872 __tmp.len()
18873 }
18874 }
18875}
18876#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
18877#[doc = ""]
18878#[doc = "ID: 117"]
18879#[derive(Debug, Clone, PartialEq)]
18880#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18881#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18882#[cfg_attr(feature = "ts", derive(TS))]
18883#[cfg_attr(feature = "ts", ts(export))]
18884pub struct LOG_REQUEST_LIST_DATA {
18885 #[doc = "First log id (0 for first available)"]
18886 pub start: u16,
18887 #[doc = "Last log id (0xffff for last available)"]
18888 pub end: u16,
18889 #[doc = "System ID"]
18890 pub target_system: u8,
18891 #[doc = "Component ID"]
18892 pub target_component: u8,
18893}
18894impl LOG_REQUEST_LIST_DATA {
18895 pub const ENCODED_LEN: usize = 6usize;
18896 pub const DEFAULT: Self = Self {
18897 start: 0_u16,
18898 end: 0_u16,
18899 target_system: 0_u8,
18900 target_component: 0_u8,
18901 };
18902 #[cfg(feature = "arbitrary")]
18903 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18904 use arbitrary::{Arbitrary, Unstructured};
18905 let mut buf = [0u8; 1024];
18906 rng.fill_bytes(&mut buf);
18907 let mut unstructured = Unstructured::new(&buf);
18908 Self::arbitrary(&mut unstructured).unwrap_or_default()
18909 }
18910}
18911impl Default for LOG_REQUEST_LIST_DATA {
18912 fn default() -> Self {
18913 Self::DEFAULT.clone()
18914 }
18915}
18916impl MessageData for LOG_REQUEST_LIST_DATA {
18917 type Message = MavMessage;
18918 const ID: u32 = 117u32;
18919 const NAME: &'static str = "LOG_REQUEST_LIST";
18920 const EXTRA_CRC: u8 = 128u8;
18921 const ENCODED_LEN: usize = 6usize;
18922 fn deser(
18923 _version: MavlinkVersion,
18924 __input: &[u8],
18925 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18926 let avail_len = __input.len();
18927 let mut payload_buf = [0; Self::ENCODED_LEN];
18928 let mut buf = if avail_len < Self::ENCODED_LEN {
18929 payload_buf[0..avail_len].copy_from_slice(__input);
18930 Bytes::new(&payload_buf)
18931 } else {
18932 Bytes::new(__input)
18933 };
18934 let mut __struct = Self::default();
18935 __struct.start = buf.get_u16_le();
18936 __struct.end = buf.get_u16_le();
18937 __struct.target_system = buf.get_u8();
18938 __struct.target_component = buf.get_u8();
18939 Ok(__struct)
18940 }
18941 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18942 let mut __tmp = BytesMut::new(bytes);
18943 #[allow(clippy::absurd_extreme_comparisons)]
18944 #[allow(unused_comparisons)]
18945 if __tmp.remaining() < Self::ENCODED_LEN {
18946 panic!(
18947 "buffer is too small (need {} bytes, but got {})",
18948 Self::ENCODED_LEN,
18949 __tmp.remaining(),
18950 )
18951 }
18952 __tmp.put_u16_le(self.start);
18953 __tmp.put_u16_le(self.end);
18954 __tmp.put_u8(self.target_system);
18955 __tmp.put_u8(self.target_component);
18956 if matches!(version, MavlinkVersion::V2) {
18957 let len = __tmp.len();
18958 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18959 } else {
18960 __tmp.len()
18961 }
18962 }
18963}
18964#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
18965#[doc = ""]
18966#[doc = "ID: 192"]
18967#[derive(Debug, Clone, PartialEq)]
18968#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18969#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18970#[cfg_attr(feature = "ts", derive(TS))]
18971#[cfg_attr(feature = "ts", ts(export))]
18972pub struct MAG_CAL_REPORT_DATA {
18973 #[doc = "RMS milligauss residuals."]
18974 pub fitness: f32,
18975 #[doc = "X offset."]
18976 pub ofs_x: f32,
18977 #[doc = "Y offset."]
18978 pub ofs_y: f32,
18979 #[doc = "Z offset."]
18980 pub ofs_z: f32,
18981 #[doc = "X diagonal (matrix 11)."]
18982 pub diag_x: f32,
18983 #[doc = "Y diagonal (matrix 22)."]
18984 pub diag_y: f32,
18985 #[doc = "Z diagonal (matrix 33)."]
18986 pub diag_z: f32,
18987 #[doc = "X off-diagonal (matrix 12 and 21)."]
18988 pub offdiag_x: f32,
18989 #[doc = "Y off-diagonal (matrix 13 and 31)."]
18990 pub offdiag_y: f32,
18991 #[doc = "Z off-diagonal (matrix 32 and 23)."]
18992 pub offdiag_z: f32,
18993 #[doc = "Compass being calibrated."]
18994 pub compass_id: u8,
18995 #[doc = "Bitmask of compasses being calibrated."]
18996 pub cal_mask: u8,
18997 #[doc = "Calibration Status."]
18998 pub cal_status: MagCalStatus,
18999 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
19000 pub autosaved: u8,
19001 #[doc = "Confidence in orientation (higher is better)."]
19002 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19003 pub orientation_confidence: f32,
19004 #[doc = "orientation before calibration."]
19005 #[cfg_attr(feature = "serde", serde(default))]
19006 pub old_orientation: MavSensorOrientation,
19007 #[doc = "orientation after calibration."]
19008 #[cfg_attr(feature = "serde", serde(default))]
19009 pub new_orientation: MavSensorOrientation,
19010 #[doc = "field radius correction factor"]
19011 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19012 pub scale_factor: f32,
19013}
19014impl MAG_CAL_REPORT_DATA {
19015 pub const ENCODED_LEN: usize = 54usize;
19016 pub const DEFAULT: Self = Self {
19017 fitness: 0.0_f32,
19018 ofs_x: 0.0_f32,
19019 ofs_y: 0.0_f32,
19020 ofs_z: 0.0_f32,
19021 diag_x: 0.0_f32,
19022 diag_y: 0.0_f32,
19023 diag_z: 0.0_f32,
19024 offdiag_x: 0.0_f32,
19025 offdiag_y: 0.0_f32,
19026 offdiag_z: 0.0_f32,
19027 compass_id: 0_u8,
19028 cal_mask: 0_u8,
19029 cal_status: MagCalStatus::DEFAULT,
19030 autosaved: 0_u8,
19031 orientation_confidence: 0.0_f32,
19032 old_orientation: MavSensorOrientation::DEFAULT,
19033 new_orientation: MavSensorOrientation::DEFAULT,
19034 scale_factor: 0.0_f32,
19035 };
19036 #[cfg(feature = "arbitrary")]
19037 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19038 use arbitrary::{Arbitrary, Unstructured};
19039 let mut buf = [0u8; 1024];
19040 rng.fill_bytes(&mut buf);
19041 let mut unstructured = Unstructured::new(&buf);
19042 Self::arbitrary(&mut unstructured).unwrap_or_default()
19043 }
19044}
19045impl Default for MAG_CAL_REPORT_DATA {
19046 fn default() -> Self {
19047 Self::DEFAULT.clone()
19048 }
19049}
19050impl MessageData for MAG_CAL_REPORT_DATA {
19051 type Message = MavMessage;
19052 const ID: u32 = 192u32;
19053 const NAME: &'static str = "MAG_CAL_REPORT";
19054 const EXTRA_CRC: u8 = 36u8;
19055 const ENCODED_LEN: usize = 54usize;
19056 fn deser(
19057 _version: MavlinkVersion,
19058 __input: &[u8],
19059 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19060 let avail_len = __input.len();
19061 let mut payload_buf = [0; Self::ENCODED_LEN];
19062 let mut buf = if avail_len < Self::ENCODED_LEN {
19063 payload_buf[0..avail_len].copy_from_slice(__input);
19064 Bytes::new(&payload_buf)
19065 } else {
19066 Bytes::new(__input)
19067 };
19068 let mut __struct = Self::default();
19069 __struct.fitness = buf.get_f32_le();
19070 __struct.ofs_x = buf.get_f32_le();
19071 __struct.ofs_y = buf.get_f32_le();
19072 __struct.ofs_z = buf.get_f32_le();
19073 __struct.diag_x = buf.get_f32_le();
19074 __struct.diag_y = buf.get_f32_le();
19075 __struct.diag_z = buf.get_f32_le();
19076 __struct.offdiag_x = buf.get_f32_le();
19077 __struct.offdiag_y = buf.get_f32_le();
19078 __struct.offdiag_z = buf.get_f32_le();
19079 __struct.compass_id = buf.get_u8();
19080 __struct.cal_mask = buf.get_u8();
19081 let tmp = buf.get_u8();
19082 __struct.cal_status =
19083 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19084 enum_type: "MagCalStatus",
19085 value: tmp as u64,
19086 })?;
19087 __struct.autosaved = buf.get_u8();
19088 __struct.orientation_confidence = buf.get_f32_le();
19089 let tmp = buf.get_u8();
19090 __struct.old_orientation =
19091 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19092 enum_type: "MavSensorOrientation",
19093 value: tmp as u64,
19094 })?;
19095 let tmp = buf.get_u8();
19096 __struct.new_orientation =
19097 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19098 enum_type: "MavSensorOrientation",
19099 value: tmp as u64,
19100 })?;
19101 __struct.scale_factor = buf.get_f32_le();
19102 Ok(__struct)
19103 }
19104 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19105 let mut __tmp = BytesMut::new(bytes);
19106 #[allow(clippy::absurd_extreme_comparisons)]
19107 #[allow(unused_comparisons)]
19108 if __tmp.remaining() < Self::ENCODED_LEN {
19109 panic!(
19110 "buffer is too small (need {} bytes, but got {})",
19111 Self::ENCODED_LEN,
19112 __tmp.remaining(),
19113 )
19114 }
19115 __tmp.put_f32_le(self.fitness);
19116 __tmp.put_f32_le(self.ofs_x);
19117 __tmp.put_f32_le(self.ofs_y);
19118 __tmp.put_f32_le(self.ofs_z);
19119 __tmp.put_f32_le(self.diag_x);
19120 __tmp.put_f32_le(self.diag_y);
19121 __tmp.put_f32_le(self.diag_z);
19122 __tmp.put_f32_le(self.offdiag_x);
19123 __tmp.put_f32_le(self.offdiag_y);
19124 __tmp.put_f32_le(self.offdiag_z);
19125 __tmp.put_u8(self.compass_id);
19126 __tmp.put_u8(self.cal_mask);
19127 __tmp.put_u8(self.cal_status as u8);
19128 __tmp.put_u8(self.autosaved);
19129 if matches!(version, MavlinkVersion::V2) {
19130 __tmp.put_f32_le(self.orientation_confidence);
19131 __tmp.put_u8(self.old_orientation as u8);
19132 __tmp.put_u8(self.new_orientation as u8);
19133 __tmp.put_f32_le(self.scale_factor);
19134 let len = __tmp.len();
19135 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19136 } else {
19137 __tmp.len()
19138 }
19139 }
19140}
19141#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
19142#[doc = ""]
19143#[doc = "ID: 69"]
19144#[derive(Debug, Clone, PartialEq)]
19145#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19146#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19147#[cfg_attr(feature = "ts", derive(TS))]
19148#[cfg_attr(feature = "ts", ts(export))]
19149pub struct MANUAL_CONTROL_DATA {
19150 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
19151 pub x: i16,
19152 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
19153 pub y: i16,
19154 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
19155 pub z: i16,
19156 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
19157 pub r: i16,
19158 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
19159 pub buttons: u16,
19160 #[doc = "The system to be controlled."]
19161 pub target: u8,
19162 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
19163 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19164 pub buttons2: u16,
19165 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
19166 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19167 pub enabled_extensions: u8,
19168 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
19169 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19170 pub s: i16,
19171 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
19172 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19173 pub t: i16,
19174 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
19175 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19176 pub aux1: i16,
19177 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
19178 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19179 pub aux2: i16,
19180 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
19181 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19182 pub aux3: i16,
19183 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
19184 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19185 pub aux4: i16,
19186 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
19187 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19188 pub aux5: i16,
19189 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
19190 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19191 pub aux6: i16,
19192}
19193impl MANUAL_CONTROL_DATA {
19194 pub const ENCODED_LEN: usize = 30usize;
19195 pub const DEFAULT: Self = Self {
19196 x: 0_i16,
19197 y: 0_i16,
19198 z: 0_i16,
19199 r: 0_i16,
19200 buttons: 0_u16,
19201 target: 0_u8,
19202 buttons2: 0_u16,
19203 enabled_extensions: 0_u8,
19204 s: 0_i16,
19205 t: 0_i16,
19206 aux1: 0_i16,
19207 aux2: 0_i16,
19208 aux3: 0_i16,
19209 aux4: 0_i16,
19210 aux5: 0_i16,
19211 aux6: 0_i16,
19212 };
19213 #[cfg(feature = "arbitrary")]
19214 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19215 use arbitrary::{Arbitrary, Unstructured};
19216 let mut buf = [0u8; 1024];
19217 rng.fill_bytes(&mut buf);
19218 let mut unstructured = Unstructured::new(&buf);
19219 Self::arbitrary(&mut unstructured).unwrap_or_default()
19220 }
19221}
19222impl Default for MANUAL_CONTROL_DATA {
19223 fn default() -> Self {
19224 Self::DEFAULT.clone()
19225 }
19226}
19227impl MessageData for MANUAL_CONTROL_DATA {
19228 type Message = MavMessage;
19229 const ID: u32 = 69u32;
19230 const NAME: &'static str = "MANUAL_CONTROL";
19231 const EXTRA_CRC: u8 = 243u8;
19232 const ENCODED_LEN: usize = 30usize;
19233 fn deser(
19234 _version: MavlinkVersion,
19235 __input: &[u8],
19236 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19237 let avail_len = __input.len();
19238 let mut payload_buf = [0; Self::ENCODED_LEN];
19239 let mut buf = if avail_len < Self::ENCODED_LEN {
19240 payload_buf[0..avail_len].copy_from_slice(__input);
19241 Bytes::new(&payload_buf)
19242 } else {
19243 Bytes::new(__input)
19244 };
19245 let mut __struct = Self::default();
19246 __struct.x = buf.get_i16_le();
19247 __struct.y = buf.get_i16_le();
19248 __struct.z = buf.get_i16_le();
19249 __struct.r = buf.get_i16_le();
19250 __struct.buttons = buf.get_u16_le();
19251 __struct.target = buf.get_u8();
19252 __struct.buttons2 = buf.get_u16_le();
19253 __struct.enabled_extensions = buf.get_u8();
19254 __struct.s = buf.get_i16_le();
19255 __struct.t = buf.get_i16_le();
19256 __struct.aux1 = buf.get_i16_le();
19257 __struct.aux2 = buf.get_i16_le();
19258 __struct.aux3 = buf.get_i16_le();
19259 __struct.aux4 = buf.get_i16_le();
19260 __struct.aux5 = buf.get_i16_le();
19261 __struct.aux6 = buf.get_i16_le();
19262 Ok(__struct)
19263 }
19264 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19265 let mut __tmp = BytesMut::new(bytes);
19266 #[allow(clippy::absurd_extreme_comparisons)]
19267 #[allow(unused_comparisons)]
19268 if __tmp.remaining() < Self::ENCODED_LEN {
19269 panic!(
19270 "buffer is too small (need {} bytes, but got {})",
19271 Self::ENCODED_LEN,
19272 __tmp.remaining(),
19273 )
19274 }
19275 __tmp.put_i16_le(self.x);
19276 __tmp.put_i16_le(self.y);
19277 __tmp.put_i16_le(self.z);
19278 __tmp.put_i16_le(self.r);
19279 __tmp.put_u16_le(self.buttons);
19280 __tmp.put_u8(self.target);
19281 if matches!(version, MavlinkVersion::V2) {
19282 __tmp.put_u16_le(self.buttons2);
19283 __tmp.put_u8(self.enabled_extensions);
19284 __tmp.put_i16_le(self.s);
19285 __tmp.put_i16_le(self.t);
19286 __tmp.put_i16_le(self.aux1);
19287 __tmp.put_i16_le(self.aux2);
19288 __tmp.put_i16_le(self.aux3);
19289 __tmp.put_i16_le(self.aux4);
19290 __tmp.put_i16_le(self.aux5);
19291 __tmp.put_i16_le(self.aux6);
19292 let len = __tmp.len();
19293 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19294 } else {
19295 __tmp.len()
19296 }
19297 }
19298}
19299#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
19300#[doc = ""]
19301#[doc = "ID: 81"]
19302#[derive(Debug, Clone, PartialEq)]
19303#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19305#[cfg_attr(feature = "ts", derive(TS))]
19306#[cfg_attr(feature = "ts", ts(export))]
19307pub struct MANUAL_SETPOINT_DATA {
19308 #[doc = "Timestamp (time since system boot)."]
19309 pub time_boot_ms: u32,
19310 #[doc = "Desired roll rate"]
19311 pub roll: f32,
19312 #[doc = "Desired pitch rate"]
19313 pub pitch: f32,
19314 #[doc = "Desired yaw rate"]
19315 pub yaw: f32,
19316 #[doc = "Collective thrust, normalized to 0 .. 1"]
19317 pub thrust: f32,
19318 #[doc = "Flight mode switch position, 0.. 255"]
19319 pub mode_switch: u8,
19320 #[doc = "Override mode switch position, 0.. 255"]
19321 pub manual_override_switch: u8,
19322}
19323impl MANUAL_SETPOINT_DATA {
19324 pub const ENCODED_LEN: usize = 22usize;
19325 pub const DEFAULT: Self = Self {
19326 time_boot_ms: 0_u32,
19327 roll: 0.0_f32,
19328 pitch: 0.0_f32,
19329 yaw: 0.0_f32,
19330 thrust: 0.0_f32,
19331 mode_switch: 0_u8,
19332 manual_override_switch: 0_u8,
19333 };
19334 #[cfg(feature = "arbitrary")]
19335 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19336 use arbitrary::{Arbitrary, Unstructured};
19337 let mut buf = [0u8; 1024];
19338 rng.fill_bytes(&mut buf);
19339 let mut unstructured = Unstructured::new(&buf);
19340 Self::arbitrary(&mut unstructured).unwrap_or_default()
19341 }
19342}
19343impl Default for MANUAL_SETPOINT_DATA {
19344 fn default() -> Self {
19345 Self::DEFAULT.clone()
19346 }
19347}
19348impl MessageData for MANUAL_SETPOINT_DATA {
19349 type Message = MavMessage;
19350 const ID: u32 = 81u32;
19351 const NAME: &'static str = "MANUAL_SETPOINT";
19352 const EXTRA_CRC: u8 = 106u8;
19353 const ENCODED_LEN: usize = 22usize;
19354 fn deser(
19355 _version: MavlinkVersion,
19356 __input: &[u8],
19357 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19358 let avail_len = __input.len();
19359 let mut payload_buf = [0; Self::ENCODED_LEN];
19360 let mut buf = if avail_len < Self::ENCODED_LEN {
19361 payload_buf[0..avail_len].copy_from_slice(__input);
19362 Bytes::new(&payload_buf)
19363 } else {
19364 Bytes::new(__input)
19365 };
19366 let mut __struct = Self::default();
19367 __struct.time_boot_ms = buf.get_u32_le();
19368 __struct.roll = buf.get_f32_le();
19369 __struct.pitch = buf.get_f32_le();
19370 __struct.yaw = buf.get_f32_le();
19371 __struct.thrust = buf.get_f32_le();
19372 __struct.mode_switch = buf.get_u8();
19373 __struct.manual_override_switch = buf.get_u8();
19374 Ok(__struct)
19375 }
19376 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19377 let mut __tmp = BytesMut::new(bytes);
19378 #[allow(clippy::absurd_extreme_comparisons)]
19379 #[allow(unused_comparisons)]
19380 if __tmp.remaining() < Self::ENCODED_LEN {
19381 panic!(
19382 "buffer is too small (need {} bytes, but got {})",
19383 Self::ENCODED_LEN,
19384 __tmp.remaining(),
19385 )
19386 }
19387 __tmp.put_u32_le(self.time_boot_ms);
19388 __tmp.put_f32_le(self.roll);
19389 __tmp.put_f32_le(self.pitch);
19390 __tmp.put_f32_le(self.yaw);
19391 __tmp.put_f32_le(self.thrust);
19392 __tmp.put_u8(self.mode_switch);
19393 __tmp.put_u8(self.manual_override_switch);
19394 if matches!(version, MavlinkVersion::V2) {
19395 let len = __tmp.len();
19396 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19397 } else {
19398 __tmp.len()
19399 }
19400 }
19401}
19402#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19403#[doc = ""]
19404#[doc = "ID: 249"]
19405#[derive(Debug, Clone, PartialEq)]
19406#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19408#[cfg_attr(feature = "ts", derive(TS))]
19409#[cfg_attr(feature = "ts", ts(export))]
19410pub struct MEMORY_VECT_DATA {
19411 #[doc = "Starting address of the debug variables"]
19412 pub address: u16,
19413 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
19414 pub ver: u8,
19415 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
19416 pub mavtype: u8,
19417 #[doc = "Memory contents at specified address"]
19418 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19419 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19420 pub value: [i8; 32],
19421}
19422impl MEMORY_VECT_DATA {
19423 pub const ENCODED_LEN: usize = 36usize;
19424 pub const DEFAULT: Self = Self {
19425 address: 0_u16,
19426 ver: 0_u8,
19427 mavtype: 0_u8,
19428 value: [0_i8; 32usize],
19429 };
19430 #[cfg(feature = "arbitrary")]
19431 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19432 use arbitrary::{Arbitrary, Unstructured};
19433 let mut buf = [0u8; 1024];
19434 rng.fill_bytes(&mut buf);
19435 let mut unstructured = Unstructured::new(&buf);
19436 Self::arbitrary(&mut unstructured).unwrap_or_default()
19437 }
19438}
19439impl Default for MEMORY_VECT_DATA {
19440 fn default() -> Self {
19441 Self::DEFAULT.clone()
19442 }
19443}
19444impl MessageData for MEMORY_VECT_DATA {
19445 type Message = MavMessage;
19446 const ID: u32 = 249u32;
19447 const NAME: &'static str = "MEMORY_VECT";
19448 const EXTRA_CRC: u8 = 204u8;
19449 const ENCODED_LEN: usize = 36usize;
19450 fn deser(
19451 _version: MavlinkVersion,
19452 __input: &[u8],
19453 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19454 let avail_len = __input.len();
19455 let mut payload_buf = [0; Self::ENCODED_LEN];
19456 let mut buf = if avail_len < Self::ENCODED_LEN {
19457 payload_buf[0..avail_len].copy_from_slice(__input);
19458 Bytes::new(&payload_buf)
19459 } else {
19460 Bytes::new(__input)
19461 };
19462 let mut __struct = Self::default();
19463 __struct.address = buf.get_u16_le();
19464 __struct.ver = buf.get_u8();
19465 __struct.mavtype = buf.get_u8();
19466 for v in &mut __struct.value {
19467 let val = buf.get_i8();
19468 *v = val;
19469 }
19470 Ok(__struct)
19471 }
19472 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19473 let mut __tmp = BytesMut::new(bytes);
19474 #[allow(clippy::absurd_extreme_comparisons)]
19475 #[allow(unused_comparisons)]
19476 if __tmp.remaining() < Self::ENCODED_LEN {
19477 panic!(
19478 "buffer is too small (need {} bytes, but got {})",
19479 Self::ENCODED_LEN,
19480 __tmp.remaining(),
19481 )
19482 }
19483 __tmp.put_u16_le(self.address);
19484 __tmp.put_u8(self.ver);
19485 __tmp.put_u8(self.mavtype);
19486 for val in &self.value {
19487 __tmp.put_i8(*val);
19488 }
19489 if matches!(version, MavlinkVersion::V2) {
19490 let len = __tmp.len();
19491 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19492 } else {
19493 __tmp.len()
19494 }
19495 }
19496}
19497#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
19498#[doc = ""]
19499#[doc = "ID: 244"]
19500#[derive(Debug, Clone, PartialEq)]
19501#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19502#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19503#[cfg_attr(feature = "ts", derive(TS))]
19504#[cfg_attr(feature = "ts", ts(export))]
19505pub struct MESSAGE_INTERVAL_DATA {
19506 #[doc = "0 indicates the interval at which it is sent."]
19507 pub interval_us: i32,
19508 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
19509 pub message_id: u16,
19510}
19511impl MESSAGE_INTERVAL_DATA {
19512 pub const ENCODED_LEN: usize = 6usize;
19513 pub const DEFAULT: Self = Self {
19514 interval_us: 0_i32,
19515 message_id: 0_u16,
19516 };
19517 #[cfg(feature = "arbitrary")]
19518 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19519 use arbitrary::{Arbitrary, Unstructured};
19520 let mut buf = [0u8; 1024];
19521 rng.fill_bytes(&mut buf);
19522 let mut unstructured = Unstructured::new(&buf);
19523 Self::arbitrary(&mut unstructured).unwrap_or_default()
19524 }
19525}
19526impl Default for MESSAGE_INTERVAL_DATA {
19527 fn default() -> Self {
19528 Self::DEFAULT.clone()
19529 }
19530}
19531impl MessageData for MESSAGE_INTERVAL_DATA {
19532 type Message = MavMessage;
19533 const ID: u32 = 244u32;
19534 const NAME: &'static str = "MESSAGE_INTERVAL";
19535 const EXTRA_CRC: u8 = 95u8;
19536 const ENCODED_LEN: usize = 6usize;
19537 fn deser(
19538 _version: MavlinkVersion,
19539 __input: &[u8],
19540 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19541 let avail_len = __input.len();
19542 let mut payload_buf = [0; Self::ENCODED_LEN];
19543 let mut buf = if avail_len < Self::ENCODED_LEN {
19544 payload_buf[0..avail_len].copy_from_slice(__input);
19545 Bytes::new(&payload_buf)
19546 } else {
19547 Bytes::new(__input)
19548 };
19549 let mut __struct = Self::default();
19550 __struct.interval_us = buf.get_i32_le();
19551 __struct.message_id = buf.get_u16_le();
19552 Ok(__struct)
19553 }
19554 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19555 let mut __tmp = BytesMut::new(bytes);
19556 #[allow(clippy::absurd_extreme_comparisons)]
19557 #[allow(unused_comparisons)]
19558 if __tmp.remaining() < Self::ENCODED_LEN {
19559 panic!(
19560 "buffer is too small (need {} bytes, but got {})",
19561 Self::ENCODED_LEN,
19562 __tmp.remaining(),
19563 )
19564 }
19565 __tmp.put_i32_le(self.interval_us);
19566 __tmp.put_u16_le(self.message_id);
19567 if matches!(version, MavlinkVersion::V2) {
19568 let len = __tmp.len();
19569 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19570 } else {
19571 __tmp.len()
19572 }
19573 }
19574}
19575#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
19576#[doc = ""]
19577#[doc = "ID: 47"]
19578#[derive(Debug, Clone, PartialEq)]
19579#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19581#[cfg_attr(feature = "ts", derive(TS))]
19582#[cfg_attr(feature = "ts", ts(export))]
19583pub struct MISSION_ACK_DATA {
19584 #[doc = "System ID"]
19585 pub target_system: u8,
19586 #[doc = "Component ID"]
19587 pub target_component: u8,
19588 #[doc = "Mission result."]
19589 pub mavtype: MavMissionResult,
19590 #[doc = "Mission type."]
19591 #[cfg_attr(feature = "serde", serde(default))]
19592 pub mission_type: MavMissionType,
19593 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
19594 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19595 pub opaque_id: u32,
19596}
19597impl MISSION_ACK_DATA {
19598 pub const ENCODED_LEN: usize = 8usize;
19599 pub const DEFAULT: Self = Self {
19600 target_system: 0_u8,
19601 target_component: 0_u8,
19602 mavtype: MavMissionResult::DEFAULT,
19603 mission_type: MavMissionType::DEFAULT,
19604 opaque_id: 0_u32,
19605 };
19606 #[cfg(feature = "arbitrary")]
19607 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19608 use arbitrary::{Arbitrary, Unstructured};
19609 let mut buf = [0u8; 1024];
19610 rng.fill_bytes(&mut buf);
19611 let mut unstructured = Unstructured::new(&buf);
19612 Self::arbitrary(&mut unstructured).unwrap_or_default()
19613 }
19614}
19615impl Default for MISSION_ACK_DATA {
19616 fn default() -> Self {
19617 Self::DEFAULT.clone()
19618 }
19619}
19620impl MessageData for MISSION_ACK_DATA {
19621 type Message = MavMessage;
19622 const ID: u32 = 47u32;
19623 const NAME: &'static str = "MISSION_ACK";
19624 const EXTRA_CRC: u8 = 153u8;
19625 const ENCODED_LEN: usize = 8usize;
19626 fn deser(
19627 _version: MavlinkVersion,
19628 __input: &[u8],
19629 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19630 let avail_len = __input.len();
19631 let mut payload_buf = [0; Self::ENCODED_LEN];
19632 let mut buf = if avail_len < Self::ENCODED_LEN {
19633 payload_buf[0..avail_len].copy_from_slice(__input);
19634 Bytes::new(&payload_buf)
19635 } else {
19636 Bytes::new(__input)
19637 };
19638 let mut __struct = Self::default();
19639 __struct.target_system = buf.get_u8();
19640 __struct.target_component = buf.get_u8();
19641 let tmp = buf.get_u8();
19642 __struct.mavtype =
19643 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19644 enum_type: "MavMissionResult",
19645 value: tmp as u64,
19646 })?;
19647 let tmp = buf.get_u8();
19648 __struct.mission_type =
19649 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19650 enum_type: "MavMissionType",
19651 value: tmp as u64,
19652 })?;
19653 __struct.opaque_id = buf.get_u32_le();
19654 Ok(__struct)
19655 }
19656 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19657 let mut __tmp = BytesMut::new(bytes);
19658 #[allow(clippy::absurd_extreme_comparisons)]
19659 #[allow(unused_comparisons)]
19660 if __tmp.remaining() < Self::ENCODED_LEN {
19661 panic!(
19662 "buffer is too small (need {} bytes, but got {})",
19663 Self::ENCODED_LEN,
19664 __tmp.remaining(),
19665 )
19666 }
19667 __tmp.put_u8(self.target_system);
19668 __tmp.put_u8(self.target_component);
19669 __tmp.put_u8(self.mavtype as u8);
19670 if matches!(version, MavlinkVersion::V2) {
19671 __tmp.put_u8(self.mission_type as u8);
19672 __tmp.put_u32_le(self.opaque_id);
19673 let len = __tmp.len();
19674 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19675 } else {
19676 __tmp.len()
19677 }
19678 }
19679}
19680#[doc = "Delete all mission items at once."]
19681#[doc = ""]
19682#[doc = "ID: 45"]
19683#[derive(Debug, Clone, PartialEq)]
19684#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19685#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19686#[cfg_attr(feature = "ts", derive(TS))]
19687#[cfg_attr(feature = "ts", ts(export))]
19688pub struct MISSION_CLEAR_ALL_DATA {
19689 #[doc = "System ID"]
19690 pub target_system: u8,
19691 #[doc = "Component ID"]
19692 pub target_component: u8,
19693 #[doc = "Mission type."]
19694 #[cfg_attr(feature = "serde", serde(default))]
19695 pub mission_type: MavMissionType,
19696}
19697impl MISSION_CLEAR_ALL_DATA {
19698 pub const ENCODED_LEN: usize = 3usize;
19699 pub const DEFAULT: Self = Self {
19700 target_system: 0_u8,
19701 target_component: 0_u8,
19702 mission_type: MavMissionType::DEFAULT,
19703 };
19704 #[cfg(feature = "arbitrary")]
19705 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19706 use arbitrary::{Arbitrary, Unstructured};
19707 let mut buf = [0u8; 1024];
19708 rng.fill_bytes(&mut buf);
19709 let mut unstructured = Unstructured::new(&buf);
19710 Self::arbitrary(&mut unstructured).unwrap_or_default()
19711 }
19712}
19713impl Default for MISSION_CLEAR_ALL_DATA {
19714 fn default() -> Self {
19715 Self::DEFAULT.clone()
19716 }
19717}
19718impl MessageData for MISSION_CLEAR_ALL_DATA {
19719 type Message = MavMessage;
19720 const ID: u32 = 45u32;
19721 const NAME: &'static str = "MISSION_CLEAR_ALL";
19722 const EXTRA_CRC: u8 = 232u8;
19723 const ENCODED_LEN: usize = 3usize;
19724 fn deser(
19725 _version: MavlinkVersion,
19726 __input: &[u8],
19727 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19728 let avail_len = __input.len();
19729 let mut payload_buf = [0; Self::ENCODED_LEN];
19730 let mut buf = if avail_len < Self::ENCODED_LEN {
19731 payload_buf[0..avail_len].copy_from_slice(__input);
19732 Bytes::new(&payload_buf)
19733 } else {
19734 Bytes::new(__input)
19735 };
19736 let mut __struct = Self::default();
19737 __struct.target_system = buf.get_u8();
19738 __struct.target_component = buf.get_u8();
19739 let tmp = buf.get_u8();
19740 __struct.mission_type =
19741 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19742 enum_type: "MavMissionType",
19743 value: tmp as u64,
19744 })?;
19745 Ok(__struct)
19746 }
19747 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19748 let mut __tmp = BytesMut::new(bytes);
19749 #[allow(clippy::absurd_extreme_comparisons)]
19750 #[allow(unused_comparisons)]
19751 if __tmp.remaining() < Self::ENCODED_LEN {
19752 panic!(
19753 "buffer is too small (need {} bytes, but got {})",
19754 Self::ENCODED_LEN,
19755 __tmp.remaining(),
19756 )
19757 }
19758 __tmp.put_u8(self.target_system);
19759 __tmp.put_u8(self.target_component);
19760 if matches!(version, MavlinkVersion::V2) {
19761 __tmp.put_u8(self.mission_type as u8);
19762 let len = __tmp.len();
19763 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19764 } else {
19765 __tmp.len()
19766 }
19767 }
19768}
19769#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
19770#[doc = ""]
19771#[doc = "ID: 44"]
19772#[derive(Debug, Clone, PartialEq)]
19773#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19774#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19775#[cfg_attr(feature = "ts", derive(TS))]
19776#[cfg_attr(feature = "ts", ts(export))]
19777pub struct MISSION_COUNT_DATA {
19778 #[doc = "Number of mission items in the sequence"]
19779 pub count: u16,
19780 #[doc = "System ID"]
19781 pub target_system: u8,
19782 #[doc = "Component ID"]
19783 pub target_component: u8,
19784 #[doc = "Mission type."]
19785 #[cfg_attr(feature = "serde", serde(default))]
19786 pub mission_type: MavMissionType,
19787 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
19788 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19789 pub opaque_id: u32,
19790}
19791impl MISSION_COUNT_DATA {
19792 pub const ENCODED_LEN: usize = 9usize;
19793 pub const DEFAULT: Self = Self {
19794 count: 0_u16,
19795 target_system: 0_u8,
19796 target_component: 0_u8,
19797 mission_type: MavMissionType::DEFAULT,
19798 opaque_id: 0_u32,
19799 };
19800 #[cfg(feature = "arbitrary")]
19801 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19802 use arbitrary::{Arbitrary, Unstructured};
19803 let mut buf = [0u8; 1024];
19804 rng.fill_bytes(&mut buf);
19805 let mut unstructured = Unstructured::new(&buf);
19806 Self::arbitrary(&mut unstructured).unwrap_or_default()
19807 }
19808}
19809impl Default for MISSION_COUNT_DATA {
19810 fn default() -> Self {
19811 Self::DEFAULT.clone()
19812 }
19813}
19814impl MessageData for MISSION_COUNT_DATA {
19815 type Message = MavMessage;
19816 const ID: u32 = 44u32;
19817 const NAME: &'static str = "MISSION_COUNT";
19818 const EXTRA_CRC: u8 = 221u8;
19819 const ENCODED_LEN: usize = 9usize;
19820 fn deser(
19821 _version: MavlinkVersion,
19822 __input: &[u8],
19823 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19824 let avail_len = __input.len();
19825 let mut payload_buf = [0; Self::ENCODED_LEN];
19826 let mut buf = if avail_len < Self::ENCODED_LEN {
19827 payload_buf[0..avail_len].copy_from_slice(__input);
19828 Bytes::new(&payload_buf)
19829 } else {
19830 Bytes::new(__input)
19831 };
19832 let mut __struct = Self::default();
19833 __struct.count = buf.get_u16_le();
19834 __struct.target_system = buf.get_u8();
19835 __struct.target_component = buf.get_u8();
19836 let tmp = buf.get_u8();
19837 __struct.mission_type =
19838 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19839 enum_type: "MavMissionType",
19840 value: tmp as u64,
19841 })?;
19842 __struct.opaque_id = buf.get_u32_le();
19843 Ok(__struct)
19844 }
19845 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19846 let mut __tmp = BytesMut::new(bytes);
19847 #[allow(clippy::absurd_extreme_comparisons)]
19848 #[allow(unused_comparisons)]
19849 if __tmp.remaining() < Self::ENCODED_LEN {
19850 panic!(
19851 "buffer is too small (need {} bytes, but got {})",
19852 Self::ENCODED_LEN,
19853 __tmp.remaining(),
19854 )
19855 }
19856 __tmp.put_u16_le(self.count);
19857 __tmp.put_u8(self.target_system);
19858 __tmp.put_u8(self.target_component);
19859 if matches!(version, MavlinkVersion::V2) {
19860 __tmp.put_u8(self.mission_type as u8);
19861 __tmp.put_u32_le(self.opaque_id);
19862 let len = __tmp.len();
19863 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19864 } else {
19865 __tmp.len()
19866 }
19867 }
19868}
19869#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
19870#[doc = ""]
19871#[doc = "ID: 42"]
19872#[derive(Debug, Clone, PartialEq)]
19873#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19874#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19875#[cfg_attr(feature = "ts", derive(TS))]
19876#[cfg_attr(feature = "ts", ts(export))]
19877pub struct MISSION_CURRENT_DATA {
19878 #[doc = "Sequence"]
19879 pub seq: u16,
19880 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
19881 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19882 pub total: u16,
19883 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
19884 #[cfg_attr(feature = "serde", serde(default))]
19885 pub mission_state: MissionState,
19886 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
19887 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19888 pub mission_mode: u8,
19889 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
19890 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19891 pub mission_id: u32,
19892 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
19893 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19894 pub fence_id: u32,
19895 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
19896 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19897 pub rally_points_id: u32,
19898}
19899impl MISSION_CURRENT_DATA {
19900 pub const ENCODED_LEN: usize = 18usize;
19901 pub const DEFAULT: Self = Self {
19902 seq: 0_u16,
19903 total: 0_u16,
19904 mission_state: MissionState::DEFAULT,
19905 mission_mode: 0_u8,
19906 mission_id: 0_u32,
19907 fence_id: 0_u32,
19908 rally_points_id: 0_u32,
19909 };
19910 #[cfg(feature = "arbitrary")]
19911 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19912 use arbitrary::{Arbitrary, Unstructured};
19913 let mut buf = [0u8; 1024];
19914 rng.fill_bytes(&mut buf);
19915 let mut unstructured = Unstructured::new(&buf);
19916 Self::arbitrary(&mut unstructured).unwrap_or_default()
19917 }
19918}
19919impl Default for MISSION_CURRENT_DATA {
19920 fn default() -> Self {
19921 Self::DEFAULT.clone()
19922 }
19923}
19924impl MessageData for MISSION_CURRENT_DATA {
19925 type Message = MavMessage;
19926 const ID: u32 = 42u32;
19927 const NAME: &'static str = "MISSION_CURRENT";
19928 const EXTRA_CRC: u8 = 28u8;
19929 const ENCODED_LEN: usize = 18usize;
19930 fn deser(
19931 _version: MavlinkVersion,
19932 __input: &[u8],
19933 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19934 let avail_len = __input.len();
19935 let mut payload_buf = [0; Self::ENCODED_LEN];
19936 let mut buf = if avail_len < Self::ENCODED_LEN {
19937 payload_buf[0..avail_len].copy_from_slice(__input);
19938 Bytes::new(&payload_buf)
19939 } else {
19940 Bytes::new(__input)
19941 };
19942 let mut __struct = Self::default();
19943 __struct.seq = buf.get_u16_le();
19944 __struct.total = buf.get_u16_le();
19945 let tmp = buf.get_u8();
19946 __struct.mission_state =
19947 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19948 enum_type: "MissionState",
19949 value: tmp as u64,
19950 })?;
19951 __struct.mission_mode = buf.get_u8();
19952 __struct.mission_id = buf.get_u32_le();
19953 __struct.fence_id = buf.get_u32_le();
19954 __struct.rally_points_id = buf.get_u32_le();
19955 Ok(__struct)
19956 }
19957 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19958 let mut __tmp = BytesMut::new(bytes);
19959 #[allow(clippy::absurd_extreme_comparisons)]
19960 #[allow(unused_comparisons)]
19961 if __tmp.remaining() < Self::ENCODED_LEN {
19962 panic!(
19963 "buffer is too small (need {} bytes, but got {})",
19964 Self::ENCODED_LEN,
19965 __tmp.remaining(),
19966 )
19967 }
19968 __tmp.put_u16_le(self.seq);
19969 if matches!(version, MavlinkVersion::V2) {
19970 __tmp.put_u16_le(self.total);
19971 __tmp.put_u8(self.mission_state as u8);
19972 __tmp.put_u8(self.mission_mode);
19973 __tmp.put_u32_le(self.mission_id);
19974 __tmp.put_u32_le(self.fence_id);
19975 __tmp.put_u32_le(self.rally_points_id);
19976 let len = __tmp.len();
19977 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19978 } else {
19979 __tmp.len()
19980 }
19981 }
19982}
19983#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
19984#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19985#[doc = ""]
19986#[doc = "ID: 39"]
19987#[derive(Debug, Clone, PartialEq)]
19988#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19989#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19990#[cfg_attr(feature = "ts", derive(TS))]
19991#[cfg_attr(feature = "ts", ts(export))]
19992pub struct MISSION_ITEM_DATA {
19993 #[doc = "PARAM1, see MAV_CMD enum"]
19994 pub param1: f32,
19995 #[doc = "PARAM2, see MAV_CMD enum"]
19996 pub param2: f32,
19997 #[doc = "PARAM3, see MAV_CMD enum"]
19998 pub param3: f32,
19999 #[doc = "PARAM4, see MAV_CMD enum"]
20000 pub param4: f32,
20001 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
20002 pub x: f32,
20003 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
20004 pub y: f32,
20005 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
20006 pub z: f32,
20007 #[doc = "Sequence"]
20008 pub seq: u16,
20009 #[doc = "The scheduled action for the waypoint."]
20010 pub command: MavCmd,
20011 #[doc = "System ID"]
20012 pub target_system: u8,
20013 #[doc = "Component ID"]
20014 pub target_component: u8,
20015 #[doc = "The coordinate system of the waypoint."]
20016 pub frame: MavFrame,
20017 #[doc = "false:0, true:1"]
20018 pub current: u8,
20019 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20020 pub autocontinue: u8,
20021 #[doc = "Mission type."]
20022 #[cfg_attr(feature = "serde", serde(default))]
20023 pub mission_type: MavMissionType,
20024}
20025impl MISSION_ITEM_DATA {
20026 pub const ENCODED_LEN: usize = 38usize;
20027 pub const DEFAULT: Self = Self {
20028 param1: 0.0_f32,
20029 param2: 0.0_f32,
20030 param3: 0.0_f32,
20031 param4: 0.0_f32,
20032 x: 0.0_f32,
20033 y: 0.0_f32,
20034 z: 0.0_f32,
20035 seq: 0_u16,
20036 command: MavCmd::DEFAULT,
20037 target_system: 0_u8,
20038 target_component: 0_u8,
20039 frame: MavFrame::DEFAULT,
20040 current: 0_u8,
20041 autocontinue: 0_u8,
20042 mission_type: MavMissionType::DEFAULT,
20043 };
20044 #[cfg(feature = "arbitrary")]
20045 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20046 use arbitrary::{Arbitrary, Unstructured};
20047 let mut buf = [0u8; 1024];
20048 rng.fill_bytes(&mut buf);
20049 let mut unstructured = Unstructured::new(&buf);
20050 Self::arbitrary(&mut unstructured).unwrap_or_default()
20051 }
20052}
20053impl Default for MISSION_ITEM_DATA {
20054 fn default() -> Self {
20055 Self::DEFAULT.clone()
20056 }
20057}
20058impl MessageData for MISSION_ITEM_DATA {
20059 type Message = MavMessage;
20060 const ID: u32 = 39u32;
20061 const NAME: &'static str = "MISSION_ITEM";
20062 const EXTRA_CRC: u8 = 254u8;
20063 const ENCODED_LEN: usize = 38usize;
20064 fn deser(
20065 _version: MavlinkVersion,
20066 __input: &[u8],
20067 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20068 let avail_len = __input.len();
20069 let mut payload_buf = [0; Self::ENCODED_LEN];
20070 let mut buf = if avail_len < Self::ENCODED_LEN {
20071 payload_buf[0..avail_len].copy_from_slice(__input);
20072 Bytes::new(&payload_buf)
20073 } else {
20074 Bytes::new(__input)
20075 };
20076 let mut __struct = Self::default();
20077 __struct.param1 = buf.get_f32_le();
20078 __struct.param2 = buf.get_f32_le();
20079 __struct.param3 = buf.get_f32_le();
20080 __struct.param4 = buf.get_f32_le();
20081 __struct.x = buf.get_f32_le();
20082 __struct.y = buf.get_f32_le();
20083 __struct.z = buf.get_f32_le();
20084 __struct.seq = buf.get_u16_le();
20085 let tmp = buf.get_u16_le();
20086 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20087 ::mavlink_core::error::ParserError::InvalidEnum {
20088 enum_type: "MavCmd",
20089 value: tmp as u64,
20090 },
20091 )?;
20092 __struct.target_system = buf.get_u8();
20093 __struct.target_component = buf.get_u8();
20094 let tmp = buf.get_u8();
20095 __struct.frame =
20096 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20097 enum_type: "MavFrame",
20098 value: tmp as u64,
20099 })?;
20100 __struct.current = buf.get_u8();
20101 __struct.autocontinue = buf.get_u8();
20102 let tmp = buf.get_u8();
20103 __struct.mission_type =
20104 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20105 enum_type: "MavMissionType",
20106 value: tmp as u64,
20107 })?;
20108 Ok(__struct)
20109 }
20110 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20111 let mut __tmp = BytesMut::new(bytes);
20112 #[allow(clippy::absurd_extreme_comparisons)]
20113 #[allow(unused_comparisons)]
20114 if __tmp.remaining() < Self::ENCODED_LEN {
20115 panic!(
20116 "buffer is too small (need {} bytes, but got {})",
20117 Self::ENCODED_LEN,
20118 __tmp.remaining(),
20119 )
20120 }
20121 __tmp.put_f32_le(self.param1);
20122 __tmp.put_f32_le(self.param2);
20123 __tmp.put_f32_le(self.param3);
20124 __tmp.put_f32_le(self.param4);
20125 __tmp.put_f32_le(self.x);
20126 __tmp.put_f32_le(self.y);
20127 __tmp.put_f32_le(self.z);
20128 __tmp.put_u16_le(self.seq);
20129 __tmp.put_u16_le(self.command as u16);
20130 __tmp.put_u8(self.target_system);
20131 __tmp.put_u8(self.target_component);
20132 __tmp.put_u8(self.frame as u8);
20133 __tmp.put_u8(self.current);
20134 __tmp.put_u8(self.autocontinue);
20135 if matches!(version, MavlinkVersion::V2) {
20136 __tmp.put_u8(self.mission_type as u8);
20137 let len = __tmp.len();
20138 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20139 } else {
20140 __tmp.len()
20141 }
20142 }
20143}
20144#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
20145#[doc = ""]
20146#[doc = "ID: 73"]
20147#[derive(Debug, Clone, PartialEq)]
20148#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20149#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20150#[cfg_attr(feature = "ts", derive(TS))]
20151#[cfg_attr(feature = "ts", ts(export))]
20152pub struct MISSION_ITEM_INT_DATA {
20153 #[doc = "PARAM1, see MAV_CMD enum"]
20154 pub param1: f32,
20155 #[doc = "PARAM2, see MAV_CMD enum"]
20156 pub param2: f32,
20157 #[doc = "PARAM3, see MAV_CMD enum"]
20158 pub param3: f32,
20159 #[doc = "PARAM4, see MAV_CMD enum"]
20160 pub param4: f32,
20161 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
20162 pub x: i32,
20163 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
20164 pub y: i32,
20165 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
20166 pub z: f32,
20167 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
20168 pub seq: u16,
20169 #[doc = "The scheduled action for the waypoint."]
20170 pub command: MavCmd,
20171 #[doc = "System ID"]
20172 pub target_system: u8,
20173 #[doc = "Component ID"]
20174 pub target_component: u8,
20175 #[doc = "The coordinate system of the waypoint."]
20176 pub frame: MavFrame,
20177 #[doc = "false:0, true:1"]
20178 pub current: u8,
20179 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20180 pub autocontinue: u8,
20181 #[doc = "Mission type."]
20182 #[cfg_attr(feature = "serde", serde(default))]
20183 pub mission_type: MavMissionType,
20184}
20185impl MISSION_ITEM_INT_DATA {
20186 pub const ENCODED_LEN: usize = 38usize;
20187 pub const DEFAULT: Self = Self {
20188 param1: 0.0_f32,
20189 param2: 0.0_f32,
20190 param3: 0.0_f32,
20191 param4: 0.0_f32,
20192 x: 0_i32,
20193 y: 0_i32,
20194 z: 0.0_f32,
20195 seq: 0_u16,
20196 command: MavCmd::DEFAULT,
20197 target_system: 0_u8,
20198 target_component: 0_u8,
20199 frame: MavFrame::DEFAULT,
20200 current: 0_u8,
20201 autocontinue: 0_u8,
20202 mission_type: MavMissionType::DEFAULT,
20203 };
20204 #[cfg(feature = "arbitrary")]
20205 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20206 use arbitrary::{Arbitrary, Unstructured};
20207 let mut buf = [0u8; 1024];
20208 rng.fill_bytes(&mut buf);
20209 let mut unstructured = Unstructured::new(&buf);
20210 Self::arbitrary(&mut unstructured).unwrap_or_default()
20211 }
20212}
20213impl Default for MISSION_ITEM_INT_DATA {
20214 fn default() -> Self {
20215 Self::DEFAULT.clone()
20216 }
20217}
20218impl MessageData for MISSION_ITEM_INT_DATA {
20219 type Message = MavMessage;
20220 const ID: u32 = 73u32;
20221 const NAME: &'static str = "MISSION_ITEM_INT";
20222 const EXTRA_CRC: u8 = 38u8;
20223 const ENCODED_LEN: usize = 38usize;
20224 fn deser(
20225 _version: MavlinkVersion,
20226 __input: &[u8],
20227 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20228 let avail_len = __input.len();
20229 let mut payload_buf = [0; Self::ENCODED_LEN];
20230 let mut buf = if avail_len < Self::ENCODED_LEN {
20231 payload_buf[0..avail_len].copy_from_slice(__input);
20232 Bytes::new(&payload_buf)
20233 } else {
20234 Bytes::new(__input)
20235 };
20236 let mut __struct = Self::default();
20237 __struct.param1 = buf.get_f32_le();
20238 __struct.param2 = buf.get_f32_le();
20239 __struct.param3 = buf.get_f32_le();
20240 __struct.param4 = buf.get_f32_le();
20241 __struct.x = buf.get_i32_le();
20242 __struct.y = buf.get_i32_le();
20243 __struct.z = buf.get_f32_le();
20244 __struct.seq = buf.get_u16_le();
20245 let tmp = buf.get_u16_le();
20246 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20247 ::mavlink_core::error::ParserError::InvalidEnum {
20248 enum_type: "MavCmd",
20249 value: tmp as u64,
20250 },
20251 )?;
20252 __struct.target_system = buf.get_u8();
20253 __struct.target_component = buf.get_u8();
20254 let tmp = buf.get_u8();
20255 __struct.frame =
20256 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20257 enum_type: "MavFrame",
20258 value: tmp as u64,
20259 })?;
20260 __struct.current = buf.get_u8();
20261 __struct.autocontinue = buf.get_u8();
20262 let tmp = buf.get_u8();
20263 __struct.mission_type =
20264 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20265 enum_type: "MavMissionType",
20266 value: tmp as u64,
20267 })?;
20268 Ok(__struct)
20269 }
20270 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20271 let mut __tmp = BytesMut::new(bytes);
20272 #[allow(clippy::absurd_extreme_comparisons)]
20273 #[allow(unused_comparisons)]
20274 if __tmp.remaining() < Self::ENCODED_LEN {
20275 panic!(
20276 "buffer is too small (need {} bytes, but got {})",
20277 Self::ENCODED_LEN,
20278 __tmp.remaining(),
20279 )
20280 }
20281 __tmp.put_f32_le(self.param1);
20282 __tmp.put_f32_le(self.param2);
20283 __tmp.put_f32_le(self.param3);
20284 __tmp.put_f32_le(self.param4);
20285 __tmp.put_i32_le(self.x);
20286 __tmp.put_i32_le(self.y);
20287 __tmp.put_f32_le(self.z);
20288 __tmp.put_u16_le(self.seq);
20289 __tmp.put_u16_le(self.command as u16);
20290 __tmp.put_u8(self.target_system);
20291 __tmp.put_u8(self.target_component);
20292 __tmp.put_u8(self.frame as u8);
20293 __tmp.put_u8(self.current);
20294 __tmp.put_u8(self.autocontinue);
20295 if matches!(version, MavlinkVersion::V2) {
20296 __tmp.put_u8(self.mission_type as u8);
20297 let len = __tmp.len();
20298 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20299 } else {
20300 __tmp.len()
20301 }
20302 }
20303}
20304#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
20305#[doc = ""]
20306#[doc = "ID: 46"]
20307#[derive(Debug, Clone, PartialEq)]
20308#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20309#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20310#[cfg_attr(feature = "ts", derive(TS))]
20311#[cfg_attr(feature = "ts", ts(export))]
20312pub struct MISSION_ITEM_REACHED_DATA {
20313 #[doc = "Sequence"]
20314 pub seq: u16,
20315}
20316impl MISSION_ITEM_REACHED_DATA {
20317 pub const ENCODED_LEN: usize = 2usize;
20318 pub const DEFAULT: Self = Self { seq: 0_u16 };
20319 #[cfg(feature = "arbitrary")]
20320 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20321 use arbitrary::{Arbitrary, Unstructured};
20322 let mut buf = [0u8; 1024];
20323 rng.fill_bytes(&mut buf);
20324 let mut unstructured = Unstructured::new(&buf);
20325 Self::arbitrary(&mut unstructured).unwrap_or_default()
20326 }
20327}
20328impl Default for MISSION_ITEM_REACHED_DATA {
20329 fn default() -> Self {
20330 Self::DEFAULT.clone()
20331 }
20332}
20333impl MessageData for MISSION_ITEM_REACHED_DATA {
20334 type Message = MavMessage;
20335 const ID: u32 = 46u32;
20336 const NAME: &'static str = "MISSION_ITEM_REACHED";
20337 const EXTRA_CRC: u8 = 11u8;
20338 const ENCODED_LEN: usize = 2usize;
20339 fn deser(
20340 _version: MavlinkVersion,
20341 __input: &[u8],
20342 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20343 let avail_len = __input.len();
20344 let mut payload_buf = [0; Self::ENCODED_LEN];
20345 let mut buf = if avail_len < Self::ENCODED_LEN {
20346 payload_buf[0..avail_len].copy_from_slice(__input);
20347 Bytes::new(&payload_buf)
20348 } else {
20349 Bytes::new(__input)
20350 };
20351 let mut __struct = Self::default();
20352 __struct.seq = buf.get_u16_le();
20353 Ok(__struct)
20354 }
20355 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20356 let mut __tmp = BytesMut::new(bytes);
20357 #[allow(clippy::absurd_extreme_comparisons)]
20358 #[allow(unused_comparisons)]
20359 if __tmp.remaining() < Self::ENCODED_LEN {
20360 panic!(
20361 "buffer is too small (need {} bytes, but got {})",
20362 Self::ENCODED_LEN,
20363 __tmp.remaining(),
20364 )
20365 }
20366 __tmp.put_u16_le(self.seq);
20367 if matches!(version, MavlinkVersion::V2) {
20368 let len = __tmp.len();
20369 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20370 } else {
20371 __tmp.len()
20372 }
20373 }
20374}
20375#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
20376#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
20377#[doc = ""]
20378#[doc = "ID: 40"]
20379#[derive(Debug, Clone, PartialEq)]
20380#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20381#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20382#[cfg_attr(feature = "ts", derive(TS))]
20383#[cfg_attr(feature = "ts", ts(export))]
20384pub struct MISSION_REQUEST_DATA {
20385 #[doc = "Sequence"]
20386 pub seq: u16,
20387 #[doc = "System ID"]
20388 pub target_system: u8,
20389 #[doc = "Component ID"]
20390 pub target_component: u8,
20391 #[doc = "Mission type."]
20392 #[cfg_attr(feature = "serde", serde(default))]
20393 pub mission_type: MavMissionType,
20394}
20395impl MISSION_REQUEST_DATA {
20396 pub const ENCODED_LEN: usize = 5usize;
20397 pub const DEFAULT: Self = Self {
20398 seq: 0_u16,
20399 target_system: 0_u8,
20400 target_component: 0_u8,
20401 mission_type: MavMissionType::DEFAULT,
20402 };
20403 #[cfg(feature = "arbitrary")]
20404 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20405 use arbitrary::{Arbitrary, Unstructured};
20406 let mut buf = [0u8; 1024];
20407 rng.fill_bytes(&mut buf);
20408 let mut unstructured = Unstructured::new(&buf);
20409 Self::arbitrary(&mut unstructured).unwrap_or_default()
20410 }
20411}
20412impl Default for MISSION_REQUEST_DATA {
20413 fn default() -> Self {
20414 Self::DEFAULT.clone()
20415 }
20416}
20417impl MessageData for MISSION_REQUEST_DATA {
20418 type Message = MavMessage;
20419 const ID: u32 = 40u32;
20420 const NAME: &'static str = "MISSION_REQUEST";
20421 const EXTRA_CRC: u8 = 230u8;
20422 const ENCODED_LEN: usize = 5usize;
20423 fn deser(
20424 _version: MavlinkVersion,
20425 __input: &[u8],
20426 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20427 let avail_len = __input.len();
20428 let mut payload_buf = [0; Self::ENCODED_LEN];
20429 let mut buf = if avail_len < Self::ENCODED_LEN {
20430 payload_buf[0..avail_len].copy_from_slice(__input);
20431 Bytes::new(&payload_buf)
20432 } else {
20433 Bytes::new(__input)
20434 };
20435 let mut __struct = Self::default();
20436 __struct.seq = buf.get_u16_le();
20437 __struct.target_system = buf.get_u8();
20438 __struct.target_component = buf.get_u8();
20439 let tmp = buf.get_u8();
20440 __struct.mission_type =
20441 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20442 enum_type: "MavMissionType",
20443 value: tmp as u64,
20444 })?;
20445 Ok(__struct)
20446 }
20447 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20448 let mut __tmp = BytesMut::new(bytes);
20449 #[allow(clippy::absurd_extreme_comparisons)]
20450 #[allow(unused_comparisons)]
20451 if __tmp.remaining() < Self::ENCODED_LEN {
20452 panic!(
20453 "buffer is too small (need {} bytes, but got {})",
20454 Self::ENCODED_LEN,
20455 __tmp.remaining(),
20456 )
20457 }
20458 __tmp.put_u16_le(self.seq);
20459 __tmp.put_u8(self.target_system);
20460 __tmp.put_u8(self.target_component);
20461 if matches!(version, MavlinkVersion::V2) {
20462 __tmp.put_u8(self.mission_type as u8);
20463 let len = __tmp.len();
20464 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20465 } else {
20466 __tmp.len()
20467 }
20468 }
20469}
20470#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
20471#[doc = ""]
20472#[doc = "ID: 51"]
20473#[derive(Debug, Clone, PartialEq)]
20474#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20475#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20476#[cfg_attr(feature = "ts", derive(TS))]
20477#[cfg_attr(feature = "ts", ts(export))]
20478pub struct MISSION_REQUEST_INT_DATA {
20479 #[doc = "Sequence"]
20480 pub seq: u16,
20481 #[doc = "System ID"]
20482 pub target_system: u8,
20483 #[doc = "Component ID"]
20484 pub target_component: u8,
20485 #[doc = "Mission type."]
20486 #[cfg_attr(feature = "serde", serde(default))]
20487 pub mission_type: MavMissionType,
20488}
20489impl MISSION_REQUEST_INT_DATA {
20490 pub const ENCODED_LEN: usize = 5usize;
20491 pub const DEFAULT: Self = Self {
20492 seq: 0_u16,
20493 target_system: 0_u8,
20494 target_component: 0_u8,
20495 mission_type: MavMissionType::DEFAULT,
20496 };
20497 #[cfg(feature = "arbitrary")]
20498 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20499 use arbitrary::{Arbitrary, Unstructured};
20500 let mut buf = [0u8; 1024];
20501 rng.fill_bytes(&mut buf);
20502 let mut unstructured = Unstructured::new(&buf);
20503 Self::arbitrary(&mut unstructured).unwrap_or_default()
20504 }
20505}
20506impl Default for MISSION_REQUEST_INT_DATA {
20507 fn default() -> Self {
20508 Self::DEFAULT.clone()
20509 }
20510}
20511impl MessageData for MISSION_REQUEST_INT_DATA {
20512 type Message = MavMessage;
20513 const ID: u32 = 51u32;
20514 const NAME: &'static str = "MISSION_REQUEST_INT";
20515 const EXTRA_CRC: u8 = 196u8;
20516 const ENCODED_LEN: usize = 5usize;
20517 fn deser(
20518 _version: MavlinkVersion,
20519 __input: &[u8],
20520 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20521 let avail_len = __input.len();
20522 let mut payload_buf = [0; Self::ENCODED_LEN];
20523 let mut buf = if avail_len < Self::ENCODED_LEN {
20524 payload_buf[0..avail_len].copy_from_slice(__input);
20525 Bytes::new(&payload_buf)
20526 } else {
20527 Bytes::new(__input)
20528 };
20529 let mut __struct = Self::default();
20530 __struct.seq = buf.get_u16_le();
20531 __struct.target_system = buf.get_u8();
20532 __struct.target_component = buf.get_u8();
20533 let tmp = buf.get_u8();
20534 __struct.mission_type =
20535 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20536 enum_type: "MavMissionType",
20537 value: tmp as u64,
20538 })?;
20539 Ok(__struct)
20540 }
20541 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20542 let mut __tmp = BytesMut::new(bytes);
20543 #[allow(clippy::absurd_extreme_comparisons)]
20544 #[allow(unused_comparisons)]
20545 if __tmp.remaining() < Self::ENCODED_LEN {
20546 panic!(
20547 "buffer is too small (need {} bytes, but got {})",
20548 Self::ENCODED_LEN,
20549 __tmp.remaining(),
20550 )
20551 }
20552 __tmp.put_u16_le(self.seq);
20553 __tmp.put_u8(self.target_system);
20554 __tmp.put_u8(self.target_component);
20555 if matches!(version, MavlinkVersion::V2) {
20556 __tmp.put_u8(self.mission_type as u8);
20557 let len = __tmp.len();
20558 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20559 } else {
20560 __tmp.len()
20561 }
20562 }
20563}
20564#[doc = "Request the overall list of mission items from the system/component."]
20565#[doc = ""]
20566#[doc = "ID: 43"]
20567#[derive(Debug, Clone, PartialEq)]
20568#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20569#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20570#[cfg_attr(feature = "ts", derive(TS))]
20571#[cfg_attr(feature = "ts", ts(export))]
20572pub struct MISSION_REQUEST_LIST_DATA {
20573 #[doc = "System ID"]
20574 pub target_system: u8,
20575 #[doc = "Component ID"]
20576 pub target_component: u8,
20577 #[doc = "Mission type."]
20578 #[cfg_attr(feature = "serde", serde(default))]
20579 pub mission_type: MavMissionType,
20580}
20581impl MISSION_REQUEST_LIST_DATA {
20582 pub const ENCODED_LEN: usize = 3usize;
20583 pub const DEFAULT: Self = Self {
20584 target_system: 0_u8,
20585 target_component: 0_u8,
20586 mission_type: MavMissionType::DEFAULT,
20587 };
20588 #[cfg(feature = "arbitrary")]
20589 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20590 use arbitrary::{Arbitrary, Unstructured};
20591 let mut buf = [0u8; 1024];
20592 rng.fill_bytes(&mut buf);
20593 let mut unstructured = Unstructured::new(&buf);
20594 Self::arbitrary(&mut unstructured).unwrap_or_default()
20595 }
20596}
20597impl Default for MISSION_REQUEST_LIST_DATA {
20598 fn default() -> Self {
20599 Self::DEFAULT.clone()
20600 }
20601}
20602impl MessageData for MISSION_REQUEST_LIST_DATA {
20603 type Message = MavMessage;
20604 const ID: u32 = 43u32;
20605 const NAME: &'static str = "MISSION_REQUEST_LIST";
20606 const EXTRA_CRC: u8 = 132u8;
20607 const ENCODED_LEN: usize = 3usize;
20608 fn deser(
20609 _version: MavlinkVersion,
20610 __input: &[u8],
20611 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20612 let avail_len = __input.len();
20613 let mut payload_buf = [0; Self::ENCODED_LEN];
20614 let mut buf = if avail_len < Self::ENCODED_LEN {
20615 payload_buf[0..avail_len].copy_from_slice(__input);
20616 Bytes::new(&payload_buf)
20617 } else {
20618 Bytes::new(__input)
20619 };
20620 let mut __struct = Self::default();
20621 __struct.target_system = buf.get_u8();
20622 __struct.target_component = buf.get_u8();
20623 let tmp = buf.get_u8();
20624 __struct.mission_type =
20625 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20626 enum_type: "MavMissionType",
20627 value: tmp as u64,
20628 })?;
20629 Ok(__struct)
20630 }
20631 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20632 let mut __tmp = BytesMut::new(bytes);
20633 #[allow(clippy::absurd_extreme_comparisons)]
20634 #[allow(unused_comparisons)]
20635 if __tmp.remaining() < Self::ENCODED_LEN {
20636 panic!(
20637 "buffer is too small (need {} bytes, but got {})",
20638 Self::ENCODED_LEN,
20639 __tmp.remaining(),
20640 )
20641 }
20642 __tmp.put_u8(self.target_system);
20643 __tmp.put_u8(self.target_component);
20644 if matches!(version, MavlinkVersion::V2) {
20645 __tmp.put_u8(self.mission_type as u8);
20646 let len = __tmp.len();
20647 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20648 } else {
20649 __tmp.len()
20650 }
20651 }
20652}
20653#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
20654#[doc = ""]
20655#[doc = "ID: 37"]
20656#[derive(Debug, Clone, PartialEq)]
20657#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20658#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20659#[cfg_attr(feature = "ts", derive(TS))]
20660#[cfg_attr(feature = "ts", ts(export))]
20661pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
20662 #[doc = "Start index"]
20663 pub start_index: i16,
20664 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
20665 pub end_index: i16,
20666 #[doc = "System ID"]
20667 pub target_system: u8,
20668 #[doc = "Component ID"]
20669 pub target_component: u8,
20670 #[doc = "Mission type."]
20671 #[cfg_attr(feature = "serde", serde(default))]
20672 pub mission_type: MavMissionType,
20673}
20674impl MISSION_REQUEST_PARTIAL_LIST_DATA {
20675 pub const ENCODED_LEN: usize = 7usize;
20676 pub const DEFAULT: Self = Self {
20677 start_index: 0_i16,
20678 end_index: 0_i16,
20679 target_system: 0_u8,
20680 target_component: 0_u8,
20681 mission_type: MavMissionType::DEFAULT,
20682 };
20683 #[cfg(feature = "arbitrary")]
20684 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20685 use arbitrary::{Arbitrary, Unstructured};
20686 let mut buf = [0u8; 1024];
20687 rng.fill_bytes(&mut buf);
20688 let mut unstructured = Unstructured::new(&buf);
20689 Self::arbitrary(&mut unstructured).unwrap_or_default()
20690 }
20691}
20692impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
20693 fn default() -> Self {
20694 Self::DEFAULT.clone()
20695 }
20696}
20697impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
20698 type Message = MavMessage;
20699 const ID: u32 = 37u32;
20700 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
20701 const EXTRA_CRC: u8 = 212u8;
20702 const ENCODED_LEN: usize = 7usize;
20703 fn deser(
20704 _version: MavlinkVersion,
20705 __input: &[u8],
20706 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20707 let avail_len = __input.len();
20708 let mut payload_buf = [0; Self::ENCODED_LEN];
20709 let mut buf = if avail_len < Self::ENCODED_LEN {
20710 payload_buf[0..avail_len].copy_from_slice(__input);
20711 Bytes::new(&payload_buf)
20712 } else {
20713 Bytes::new(__input)
20714 };
20715 let mut __struct = Self::default();
20716 __struct.start_index = buf.get_i16_le();
20717 __struct.end_index = buf.get_i16_le();
20718 __struct.target_system = buf.get_u8();
20719 __struct.target_component = buf.get_u8();
20720 let tmp = buf.get_u8();
20721 __struct.mission_type =
20722 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20723 enum_type: "MavMissionType",
20724 value: tmp as u64,
20725 })?;
20726 Ok(__struct)
20727 }
20728 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20729 let mut __tmp = BytesMut::new(bytes);
20730 #[allow(clippy::absurd_extreme_comparisons)]
20731 #[allow(unused_comparisons)]
20732 if __tmp.remaining() < Self::ENCODED_LEN {
20733 panic!(
20734 "buffer is too small (need {} bytes, but got {})",
20735 Self::ENCODED_LEN,
20736 __tmp.remaining(),
20737 )
20738 }
20739 __tmp.put_i16_le(self.start_index);
20740 __tmp.put_i16_le(self.end_index);
20741 __tmp.put_u8(self.target_system);
20742 __tmp.put_u8(self.target_component);
20743 if matches!(version, MavlinkVersion::V2) {
20744 __tmp.put_u8(self.mission_type as u8);
20745 let len = __tmp.len();
20746 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20747 } else {
20748 __tmp.len()
20749 }
20750 }
20751}
20752#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
20753#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
20754#[doc = ""]
20755#[doc = "ID: 41"]
20756#[derive(Debug, Clone, PartialEq)]
20757#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20758#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20759#[cfg_attr(feature = "ts", derive(TS))]
20760#[cfg_attr(feature = "ts", ts(export))]
20761pub struct MISSION_SET_CURRENT_DATA {
20762 #[doc = "Sequence"]
20763 pub seq: u16,
20764 #[doc = "System ID"]
20765 pub target_system: u8,
20766 #[doc = "Component ID"]
20767 pub target_component: u8,
20768}
20769impl MISSION_SET_CURRENT_DATA {
20770 pub const ENCODED_LEN: usize = 4usize;
20771 pub const DEFAULT: Self = Self {
20772 seq: 0_u16,
20773 target_system: 0_u8,
20774 target_component: 0_u8,
20775 };
20776 #[cfg(feature = "arbitrary")]
20777 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20778 use arbitrary::{Arbitrary, Unstructured};
20779 let mut buf = [0u8; 1024];
20780 rng.fill_bytes(&mut buf);
20781 let mut unstructured = Unstructured::new(&buf);
20782 Self::arbitrary(&mut unstructured).unwrap_or_default()
20783 }
20784}
20785impl Default for MISSION_SET_CURRENT_DATA {
20786 fn default() -> Self {
20787 Self::DEFAULT.clone()
20788 }
20789}
20790impl MessageData for MISSION_SET_CURRENT_DATA {
20791 type Message = MavMessage;
20792 const ID: u32 = 41u32;
20793 const NAME: &'static str = "MISSION_SET_CURRENT";
20794 const EXTRA_CRC: u8 = 28u8;
20795 const ENCODED_LEN: usize = 4usize;
20796 fn deser(
20797 _version: MavlinkVersion,
20798 __input: &[u8],
20799 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20800 let avail_len = __input.len();
20801 let mut payload_buf = [0; Self::ENCODED_LEN];
20802 let mut buf = if avail_len < Self::ENCODED_LEN {
20803 payload_buf[0..avail_len].copy_from_slice(__input);
20804 Bytes::new(&payload_buf)
20805 } else {
20806 Bytes::new(__input)
20807 };
20808 let mut __struct = Self::default();
20809 __struct.seq = buf.get_u16_le();
20810 __struct.target_system = buf.get_u8();
20811 __struct.target_component = buf.get_u8();
20812 Ok(__struct)
20813 }
20814 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20815 let mut __tmp = BytesMut::new(bytes);
20816 #[allow(clippy::absurd_extreme_comparisons)]
20817 #[allow(unused_comparisons)]
20818 if __tmp.remaining() < Self::ENCODED_LEN {
20819 panic!(
20820 "buffer is too small (need {} bytes, but got {})",
20821 Self::ENCODED_LEN,
20822 __tmp.remaining(),
20823 )
20824 }
20825 __tmp.put_u16_le(self.seq);
20826 __tmp.put_u8(self.target_system);
20827 __tmp.put_u8(self.target_component);
20828 if matches!(version, MavlinkVersion::V2) {
20829 let len = __tmp.len();
20830 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20831 } else {
20832 __tmp.len()
20833 }
20834 }
20835}
20836#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
20837#[doc = ""]
20838#[doc = "ID: 38"]
20839#[derive(Debug, Clone, PartialEq)]
20840#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20841#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20842#[cfg_attr(feature = "ts", derive(TS))]
20843#[cfg_attr(feature = "ts", ts(export))]
20844pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
20845 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
20846 pub start_index: i16,
20847 #[doc = "End index, equal or greater than start index."]
20848 pub end_index: i16,
20849 #[doc = "System ID"]
20850 pub target_system: u8,
20851 #[doc = "Component ID"]
20852 pub target_component: u8,
20853 #[doc = "Mission type."]
20854 #[cfg_attr(feature = "serde", serde(default))]
20855 pub mission_type: MavMissionType,
20856}
20857impl MISSION_WRITE_PARTIAL_LIST_DATA {
20858 pub const ENCODED_LEN: usize = 7usize;
20859 pub const DEFAULT: Self = Self {
20860 start_index: 0_i16,
20861 end_index: 0_i16,
20862 target_system: 0_u8,
20863 target_component: 0_u8,
20864 mission_type: MavMissionType::DEFAULT,
20865 };
20866 #[cfg(feature = "arbitrary")]
20867 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20868 use arbitrary::{Arbitrary, Unstructured};
20869 let mut buf = [0u8; 1024];
20870 rng.fill_bytes(&mut buf);
20871 let mut unstructured = Unstructured::new(&buf);
20872 Self::arbitrary(&mut unstructured).unwrap_or_default()
20873 }
20874}
20875impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
20876 fn default() -> Self {
20877 Self::DEFAULT.clone()
20878 }
20879}
20880impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
20881 type Message = MavMessage;
20882 const ID: u32 = 38u32;
20883 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
20884 const EXTRA_CRC: u8 = 9u8;
20885 const ENCODED_LEN: usize = 7usize;
20886 fn deser(
20887 _version: MavlinkVersion,
20888 __input: &[u8],
20889 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20890 let avail_len = __input.len();
20891 let mut payload_buf = [0; Self::ENCODED_LEN];
20892 let mut buf = if avail_len < Self::ENCODED_LEN {
20893 payload_buf[0..avail_len].copy_from_slice(__input);
20894 Bytes::new(&payload_buf)
20895 } else {
20896 Bytes::new(__input)
20897 };
20898 let mut __struct = Self::default();
20899 __struct.start_index = buf.get_i16_le();
20900 __struct.end_index = buf.get_i16_le();
20901 __struct.target_system = buf.get_u8();
20902 __struct.target_component = buf.get_u8();
20903 let tmp = buf.get_u8();
20904 __struct.mission_type =
20905 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20906 enum_type: "MavMissionType",
20907 value: tmp as u64,
20908 })?;
20909 Ok(__struct)
20910 }
20911 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20912 let mut __tmp = BytesMut::new(bytes);
20913 #[allow(clippy::absurd_extreme_comparisons)]
20914 #[allow(unused_comparisons)]
20915 if __tmp.remaining() < Self::ENCODED_LEN {
20916 panic!(
20917 "buffer is too small (need {} bytes, but got {})",
20918 Self::ENCODED_LEN,
20919 __tmp.remaining(),
20920 )
20921 }
20922 __tmp.put_i16_le(self.start_index);
20923 __tmp.put_i16_le(self.end_index);
20924 __tmp.put_u8(self.target_system);
20925 __tmp.put_u8(self.target_component);
20926 if matches!(version, MavlinkVersion::V2) {
20927 __tmp.put_u8(self.mission_type as u8);
20928 let len = __tmp.len();
20929 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20930 } else {
20931 __tmp.len()
20932 }
20933 }
20934}
20935#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
20936#[doc = "Orientation of a mount."]
20937#[doc = ""]
20938#[doc = "ID: 265"]
20939#[derive(Debug, Clone, PartialEq)]
20940#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20941#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20942#[cfg_attr(feature = "ts", derive(TS))]
20943#[cfg_attr(feature = "ts", ts(export))]
20944pub struct MOUNT_ORIENTATION_DATA {
20945 #[doc = "Timestamp (time since system boot)."]
20946 pub time_boot_ms: u32,
20947 #[doc = "Roll in global frame (set to NaN for invalid)."]
20948 pub roll: f32,
20949 #[doc = "Pitch in global frame (set to NaN for invalid)."]
20950 pub pitch: f32,
20951 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
20952 pub yaw: f32,
20953 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
20954 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20955 pub yaw_absolute: f32,
20956}
20957impl MOUNT_ORIENTATION_DATA {
20958 pub const ENCODED_LEN: usize = 20usize;
20959 pub const DEFAULT: Self = Self {
20960 time_boot_ms: 0_u32,
20961 roll: 0.0_f32,
20962 pitch: 0.0_f32,
20963 yaw: 0.0_f32,
20964 yaw_absolute: 0.0_f32,
20965 };
20966 #[cfg(feature = "arbitrary")]
20967 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20968 use arbitrary::{Arbitrary, Unstructured};
20969 let mut buf = [0u8; 1024];
20970 rng.fill_bytes(&mut buf);
20971 let mut unstructured = Unstructured::new(&buf);
20972 Self::arbitrary(&mut unstructured).unwrap_or_default()
20973 }
20974}
20975impl Default for MOUNT_ORIENTATION_DATA {
20976 fn default() -> Self {
20977 Self::DEFAULT.clone()
20978 }
20979}
20980impl MessageData for MOUNT_ORIENTATION_DATA {
20981 type Message = MavMessage;
20982 const ID: u32 = 265u32;
20983 const NAME: &'static str = "MOUNT_ORIENTATION";
20984 const EXTRA_CRC: u8 = 26u8;
20985 const ENCODED_LEN: usize = 20usize;
20986 fn deser(
20987 _version: MavlinkVersion,
20988 __input: &[u8],
20989 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20990 let avail_len = __input.len();
20991 let mut payload_buf = [0; Self::ENCODED_LEN];
20992 let mut buf = if avail_len < Self::ENCODED_LEN {
20993 payload_buf[0..avail_len].copy_from_slice(__input);
20994 Bytes::new(&payload_buf)
20995 } else {
20996 Bytes::new(__input)
20997 };
20998 let mut __struct = Self::default();
20999 __struct.time_boot_ms = buf.get_u32_le();
21000 __struct.roll = buf.get_f32_le();
21001 __struct.pitch = buf.get_f32_le();
21002 __struct.yaw = buf.get_f32_le();
21003 __struct.yaw_absolute = buf.get_f32_le();
21004 Ok(__struct)
21005 }
21006 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21007 let mut __tmp = BytesMut::new(bytes);
21008 #[allow(clippy::absurd_extreme_comparisons)]
21009 #[allow(unused_comparisons)]
21010 if __tmp.remaining() < Self::ENCODED_LEN {
21011 panic!(
21012 "buffer is too small (need {} bytes, but got {})",
21013 Self::ENCODED_LEN,
21014 __tmp.remaining(),
21015 )
21016 }
21017 __tmp.put_u32_le(self.time_boot_ms);
21018 __tmp.put_f32_le(self.roll);
21019 __tmp.put_f32_le(self.pitch);
21020 __tmp.put_f32_le(self.yaw);
21021 if matches!(version, MavlinkVersion::V2) {
21022 __tmp.put_f32_le(self.yaw_absolute);
21023 let len = __tmp.len();
21024 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21025 } else {
21026 __tmp.len()
21027 }
21028 }
21029}
21030#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
21031#[doc = ""]
21032#[doc = "ID: 251"]
21033#[derive(Debug, Clone, PartialEq)]
21034#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21035#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21036#[cfg_attr(feature = "ts", derive(TS))]
21037#[cfg_attr(feature = "ts", ts(export))]
21038pub struct NAMED_VALUE_FLOAT_DATA {
21039 #[doc = "Timestamp (time since system boot)."]
21040 pub time_boot_ms: u32,
21041 #[doc = "Floating point value"]
21042 pub value: f32,
21043 #[doc = "Name of the debug variable"]
21044 #[cfg_attr(feature = "ts", ts(type = "string"))]
21045 pub name: CharArray<10>,
21046}
21047impl NAMED_VALUE_FLOAT_DATA {
21048 pub const ENCODED_LEN: usize = 18usize;
21049 pub const DEFAULT: Self = Self {
21050 time_boot_ms: 0_u32,
21051 value: 0.0_f32,
21052 name: CharArray::new([0_u8; 10usize]),
21053 };
21054 #[cfg(feature = "arbitrary")]
21055 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21056 use arbitrary::{Arbitrary, Unstructured};
21057 let mut buf = [0u8; 1024];
21058 rng.fill_bytes(&mut buf);
21059 let mut unstructured = Unstructured::new(&buf);
21060 Self::arbitrary(&mut unstructured).unwrap_or_default()
21061 }
21062}
21063impl Default for NAMED_VALUE_FLOAT_DATA {
21064 fn default() -> Self {
21065 Self::DEFAULT.clone()
21066 }
21067}
21068impl MessageData for NAMED_VALUE_FLOAT_DATA {
21069 type Message = MavMessage;
21070 const ID: u32 = 251u32;
21071 const NAME: &'static str = "NAMED_VALUE_FLOAT";
21072 const EXTRA_CRC: u8 = 170u8;
21073 const ENCODED_LEN: usize = 18usize;
21074 fn deser(
21075 _version: MavlinkVersion,
21076 __input: &[u8],
21077 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21078 let avail_len = __input.len();
21079 let mut payload_buf = [0; Self::ENCODED_LEN];
21080 let mut buf = if avail_len < Self::ENCODED_LEN {
21081 payload_buf[0..avail_len].copy_from_slice(__input);
21082 Bytes::new(&payload_buf)
21083 } else {
21084 Bytes::new(__input)
21085 };
21086 let mut __struct = Self::default();
21087 __struct.time_boot_ms = buf.get_u32_le();
21088 __struct.value = buf.get_f32_le();
21089 let mut tmp = [0_u8; 10usize];
21090 for v in &mut tmp {
21091 *v = buf.get_u8();
21092 }
21093 __struct.name = CharArray::new(tmp);
21094 Ok(__struct)
21095 }
21096 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21097 let mut __tmp = BytesMut::new(bytes);
21098 #[allow(clippy::absurd_extreme_comparisons)]
21099 #[allow(unused_comparisons)]
21100 if __tmp.remaining() < Self::ENCODED_LEN {
21101 panic!(
21102 "buffer is too small (need {} bytes, but got {})",
21103 Self::ENCODED_LEN,
21104 __tmp.remaining(),
21105 )
21106 }
21107 __tmp.put_u32_le(self.time_boot_ms);
21108 __tmp.put_f32_le(self.value);
21109 for val in &self.name {
21110 __tmp.put_u8(*val);
21111 }
21112 if matches!(version, MavlinkVersion::V2) {
21113 let len = __tmp.len();
21114 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21115 } else {
21116 __tmp.len()
21117 }
21118 }
21119}
21120#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
21121#[doc = ""]
21122#[doc = "ID: 252"]
21123#[derive(Debug, Clone, PartialEq)]
21124#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21125#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21126#[cfg_attr(feature = "ts", derive(TS))]
21127#[cfg_attr(feature = "ts", ts(export))]
21128pub struct NAMED_VALUE_INT_DATA {
21129 #[doc = "Timestamp (time since system boot)."]
21130 pub time_boot_ms: u32,
21131 #[doc = "Signed integer value"]
21132 pub value: i32,
21133 #[doc = "Name of the debug variable"]
21134 #[cfg_attr(feature = "ts", ts(type = "string"))]
21135 pub name: CharArray<10>,
21136}
21137impl NAMED_VALUE_INT_DATA {
21138 pub const ENCODED_LEN: usize = 18usize;
21139 pub const DEFAULT: Self = Self {
21140 time_boot_ms: 0_u32,
21141 value: 0_i32,
21142 name: CharArray::new([0_u8; 10usize]),
21143 };
21144 #[cfg(feature = "arbitrary")]
21145 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21146 use arbitrary::{Arbitrary, Unstructured};
21147 let mut buf = [0u8; 1024];
21148 rng.fill_bytes(&mut buf);
21149 let mut unstructured = Unstructured::new(&buf);
21150 Self::arbitrary(&mut unstructured).unwrap_or_default()
21151 }
21152}
21153impl Default for NAMED_VALUE_INT_DATA {
21154 fn default() -> Self {
21155 Self::DEFAULT.clone()
21156 }
21157}
21158impl MessageData for NAMED_VALUE_INT_DATA {
21159 type Message = MavMessage;
21160 const ID: u32 = 252u32;
21161 const NAME: &'static str = "NAMED_VALUE_INT";
21162 const EXTRA_CRC: u8 = 44u8;
21163 const ENCODED_LEN: usize = 18usize;
21164 fn deser(
21165 _version: MavlinkVersion,
21166 __input: &[u8],
21167 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21168 let avail_len = __input.len();
21169 let mut payload_buf = [0; Self::ENCODED_LEN];
21170 let mut buf = if avail_len < Self::ENCODED_LEN {
21171 payload_buf[0..avail_len].copy_from_slice(__input);
21172 Bytes::new(&payload_buf)
21173 } else {
21174 Bytes::new(__input)
21175 };
21176 let mut __struct = Self::default();
21177 __struct.time_boot_ms = buf.get_u32_le();
21178 __struct.value = buf.get_i32_le();
21179 let mut tmp = [0_u8; 10usize];
21180 for v in &mut tmp {
21181 *v = buf.get_u8();
21182 }
21183 __struct.name = CharArray::new(tmp);
21184 Ok(__struct)
21185 }
21186 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21187 let mut __tmp = BytesMut::new(bytes);
21188 #[allow(clippy::absurd_extreme_comparisons)]
21189 #[allow(unused_comparisons)]
21190 if __tmp.remaining() < Self::ENCODED_LEN {
21191 panic!(
21192 "buffer is too small (need {} bytes, but got {})",
21193 Self::ENCODED_LEN,
21194 __tmp.remaining(),
21195 )
21196 }
21197 __tmp.put_u32_le(self.time_boot_ms);
21198 __tmp.put_i32_le(self.value);
21199 for val in &self.name {
21200 __tmp.put_u8(*val);
21201 }
21202 if matches!(version, MavlinkVersion::V2) {
21203 let len = __tmp.len();
21204 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21205 } else {
21206 __tmp.len()
21207 }
21208 }
21209}
21210#[doc = "The state of the navigation and position controller."]
21211#[doc = ""]
21212#[doc = "ID: 62"]
21213#[derive(Debug, Clone, PartialEq)]
21214#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21216#[cfg_attr(feature = "ts", derive(TS))]
21217#[cfg_attr(feature = "ts", ts(export))]
21218pub struct NAV_CONTROLLER_OUTPUT_DATA {
21219 #[doc = "Current desired roll"]
21220 pub nav_roll: f32,
21221 #[doc = "Current desired pitch"]
21222 pub nav_pitch: f32,
21223 #[doc = "Current altitude error"]
21224 pub alt_error: f32,
21225 #[doc = "Current airspeed error"]
21226 pub aspd_error: f32,
21227 #[doc = "Current crosstrack error on x-y plane"]
21228 pub xtrack_error: f32,
21229 #[doc = "Current desired heading"]
21230 pub nav_bearing: i16,
21231 #[doc = "Bearing to current waypoint/target"]
21232 pub target_bearing: i16,
21233 #[doc = "Distance to active waypoint"]
21234 pub wp_dist: u16,
21235}
21236impl NAV_CONTROLLER_OUTPUT_DATA {
21237 pub const ENCODED_LEN: usize = 26usize;
21238 pub const DEFAULT: Self = Self {
21239 nav_roll: 0.0_f32,
21240 nav_pitch: 0.0_f32,
21241 alt_error: 0.0_f32,
21242 aspd_error: 0.0_f32,
21243 xtrack_error: 0.0_f32,
21244 nav_bearing: 0_i16,
21245 target_bearing: 0_i16,
21246 wp_dist: 0_u16,
21247 };
21248 #[cfg(feature = "arbitrary")]
21249 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21250 use arbitrary::{Arbitrary, Unstructured};
21251 let mut buf = [0u8; 1024];
21252 rng.fill_bytes(&mut buf);
21253 let mut unstructured = Unstructured::new(&buf);
21254 Self::arbitrary(&mut unstructured).unwrap_or_default()
21255 }
21256}
21257impl Default for NAV_CONTROLLER_OUTPUT_DATA {
21258 fn default() -> Self {
21259 Self::DEFAULT.clone()
21260 }
21261}
21262impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
21263 type Message = MavMessage;
21264 const ID: u32 = 62u32;
21265 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
21266 const EXTRA_CRC: u8 = 183u8;
21267 const ENCODED_LEN: usize = 26usize;
21268 fn deser(
21269 _version: MavlinkVersion,
21270 __input: &[u8],
21271 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21272 let avail_len = __input.len();
21273 let mut payload_buf = [0; Self::ENCODED_LEN];
21274 let mut buf = if avail_len < Self::ENCODED_LEN {
21275 payload_buf[0..avail_len].copy_from_slice(__input);
21276 Bytes::new(&payload_buf)
21277 } else {
21278 Bytes::new(__input)
21279 };
21280 let mut __struct = Self::default();
21281 __struct.nav_roll = buf.get_f32_le();
21282 __struct.nav_pitch = buf.get_f32_le();
21283 __struct.alt_error = buf.get_f32_le();
21284 __struct.aspd_error = buf.get_f32_le();
21285 __struct.xtrack_error = buf.get_f32_le();
21286 __struct.nav_bearing = buf.get_i16_le();
21287 __struct.target_bearing = buf.get_i16_le();
21288 __struct.wp_dist = buf.get_u16_le();
21289 Ok(__struct)
21290 }
21291 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21292 let mut __tmp = BytesMut::new(bytes);
21293 #[allow(clippy::absurd_extreme_comparisons)]
21294 #[allow(unused_comparisons)]
21295 if __tmp.remaining() < Self::ENCODED_LEN {
21296 panic!(
21297 "buffer is too small (need {} bytes, but got {})",
21298 Self::ENCODED_LEN,
21299 __tmp.remaining(),
21300 )
21301 }
21302 __tmp.put_f32_le(self.nav_roll);
21303 __tmp.put_f32_le(self.nav_pitch);
21304 __tmp.put_f32_le(self.alt_error);
21305 __tmp.put_f32_le(self.aspd_error);
21306 __tmp.put_f32_le(self.xtrack_error);
21307 __tmp.put_i16_le(self.nav_bearing);
21308 __tmp.put_i16_le(self.target_bearing);
21309 __tmp.put_u16_le(self.wp_dist);
21310 if matches!(version, MavlinkVersion::V2) {
21311 let len = __tmp.len();
21312 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21313 } else {
21314 __tmp.len()
21315 }
21316 }
21317}
21318#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
21319#[doc = ""]
21320#[doc = "ID: 330"]
21321#[derive(Debug, Clone, PartialEq)]
21322#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21323#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21324#[cfg_attr(feature = "ts", derive(TS))]
21325#[cfg_attr(feature = "ts", ts(export))]
21326pub struct OBSTACLE_DISTANCE_DATA {
21327 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21328 pub time_usec: u64,
21329 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
21330 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21331 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21332 pub distances: [u16; 72],
21333 #[doc = "Minimum distance the sensor can measure."]
21334 pub min_distance: u16,
21335 #[doc = "Maximum distance the sensor can measure."]
21336 pub max_distance: u16,
21337 #[doc = "Class id of the distance sensor type."]
21338 pub sensor_type: MavDistanceSensor,
21339 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
21340 pub increment: u8,
21341 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
21342 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21343 pub increment_f: f32,
21344 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
21345 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21346 pub angle_offset: f32,
21347 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
21348 #[cfg_attr(feature = "serde", serde(default))]
21349 pub frame: MavFrame,
21350}
21351impl OBSTACLE_DISTANCE_DATA {
21352 pub const ENCODED_LEN: usize = 167usize;
21353 pub const DEFAULT: Self = Self {
21354 time_usec: 0_u64,
21355 distances: [0_u16; 72usize],
21356 min_distance: 0_u16,
21357 max_distance: 0_u16,
21358 sensor_type: MavDistanceSensor::DEFAULT,
21359 increment: 0_u8,
21360 increment_f: 0.0_f32,
21361 angle_offset: 0.0_f32,
21362 frame: MavFrame::DEFAULT,
21363 };
21364 #[cfg(feature = "arbitrary")]
21365 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21366 use arbitrary::{Arbitrary, Unstructured};
21367 let mut buf = [0u8; 1024];
21368 rng.fill_bytes(&mut buf);
21369 let mut unstructured = Unstructured::new(&buf);
21370 Self::arbitrary(&mut unstructured).unwrap_or_default()
21371 }
21372}
21373impl Default for OBSTACLE_DISTANCE_DATA {
21374 fn default() -> Self {
21375 Self::DEFAULT.clone()
21376 }
21377}
21378impl MessageData for OBSTACLE_DISTANCE_DATA {
21379 type Message = MavMessage;
21380 const ID: u32 = 330u32;
21381 const NAME: &'static str = "OBSTACLE_DISTANCE";
21382 const EXTRA_CRC: u8 = 23u8;
21383 const ENCODED_LEN: usize = 167usize;
21384 fn deser(
21385 _version: MavlinkVersion,
21386 __input: &[u8],
21387 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21388 let avail_len = __input.len();
21389 let mut payload_buf = [0; Self::ENCODED_LEN];
21390 let mut buf = if avail_len < Self::ENCODED_LEN {
21391 payload_buf[0..avail_len].copy_from_slice(__input);
21392 Bytes::new(&payload_buf)
21393 } else {
21394 Bytes::new(__input)
21395 };
21396 let mut __struct = Self::default();
21397 __struct.time_usec = buf.get_u64_le();
21398 for v in &mut __struct.distances {
21399 let val = buf.get_u16_le();
21400 *v = val;
21401 }
21402 __struct.min_distance = buf.get_u16_le();
21403 __struct.max_distance = buf.get_u16_le();
21404 let tmp = buf.get_u8();
21405 __struct.sensor_type =
21406 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21407 enum_type: "MavDistanceSensor",
21408 value: tmp as u64,
21409 })?;
21410 __struct.increment = buf.get_u8();
21411 __struct.increment_f = buf.get_f32_le();
21412 __struct.angle_offset = buf.get_f32_le();
21413 let tmp = buf.get_u8();
21414 __struct.frame =
21415 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21416 enum_type: "MavFrame",
21417 value: tmp as u64,
21418 })?;
21419 Ok(__struct)
21420 }
21421 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21422 let mut __tmp = BytesMut::new(bytes);
21423 #[allow(clippy::absurd_extreme_comparisons)]
21424 #[allow(unused_comparisons)]
21425 if __tmp.remaining() < Self::ENCODED_LEN {
21426 panic!(
21427 "buffer is too small (need {} bytes, but got {})",
21428 Self::ENCODED_LEN,
21429 __tmp.remaining(),
21430 )
21431 }
21432 __tmp.put_u64_le(self.time_usec);
21433 for val in &self.distances {
21434 __tmp.put_u16_le(*val);
21435 }
21436 __tmp.put_u16_le(self.min_distance);
21437 __tmp.put_u16_le(self.max_distance);
21438 __tmp.put_u8(self.sensor_type as u8);
21439 __tmp.put_u8(self.increment);
21440 if matches!(version, MavlinkVersion::V2) {
21441 __tmp.put_f32_le(self.increment_f);
21442 __tmp.put_f32_le(self.angle_offset);
21443 __tmp.put_u8(self.frame as u8);
21444 let len = __tmp.len();
21445 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21446 } else {
21447 __tmp.len()
21448 }
21449 }
21450}
21451#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
21452#[doc = ""]
21453#[doc = "ID: 331"]
21454#[derive(Debug, Clone, PartialEq)]
21455#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21456#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21457#[cfg_attr(feature = "ts", derive(TS))]
21458#[cfg_attr(feature = "ts", ts(export))]
21459pub struct ODOMETRY_DATA {
21460 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21461 pub time_usec: u64,
21462 #[doc = "X Position"]
21463 pub x: f32,
21464 #[doc = "Y Position"]
21465 pub y: f32,
21466 #[doc = "Z Position"]
21467 pub z: f32,
21468 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
21469 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21470 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21471 pub q: [f32; 4],
21472 #[doc = "X linear speed"]
21473 pub vx: f32,
21474 #[doc = "Y linear speed"]
21475 pub vy: f32,
21476 #[doc = "Z linear speed"]
21477 pub vz: f32,
21478 #[doc = "Roll angular speed"]
21479 pub rollspeed: f32,
21480 #[doc = "Pitch angular speed"]
21481 pub pitchspeed: f32,
21482 #[doc = "Yaw angular speed"]
21483 pub yawspeed: f32,
21484 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21485 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21486 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21487 pub pose_covariance: [f32; 21],
21488 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21489 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21490 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21491 pub velocity_covariance: [f32; 21],
21492 #[doc = "Coordinate frame of reference for the pose data."]
21493 pub frame_id: MavFrame,
21494 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
21495 pub child_frame_id: MavFrame,
21496 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
21497 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21498 pub reset_counter: u8,
21499 #[doc = "Type of estimator that is providing the odometry."]
21500 #[cfg_attr(feature = "serde", serde(default))]
21501 pub estimator_type: MavEstimatorType,
21502 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
21503 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21504 pub quality: i8,
21505}
21506impl ODOMETRY_DATA {
21507 pub const ENCODED_LEN: usize = 233usize;
21508 pub const DEFAULT: Self = Self {
21509 time_usec: 0_u64,
21510 x: 0.0_f32,
21511 y: 0.0_f32,
21512 z: 0.0_f32,
21513 q: [0.0_f32; 4usize],
21514 vx: 0.0_f32,
21515 vy: 0.0_f32,
21516 vz: 0.0_f32,
21517 rollspeed: 0.0_f32,
21518 pitchspeed: 0.0_f32,
21519 yawspeed: 0.0_f32,
21520 pose_covariance: [0.0_f32; 21usize],
21521 velocity_covariance: [0.0_f32; 21usize],
21522 frame_id: MavFrame::DEFAULT,
21523 child_frame_id: MavFrame::DEFAULT,
21524 reset_counter: 0_u8,
21525 estimator_type: MavEstimatorType::DEFAULT,
21526 quality: 0_i8,
21527 };
21528 #[cfg(feature = "arbitrary")]
21529 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21530 use arbitrary::{Arbitrary, Unstructured};
21531 let mut buf = [0u8; 1024];
21532 rng.fill_bytes(&mut buf);
21533 let mut unstructured = Unstructured::new(&buf);
21534 Self::arbitrary(&mut unstructured).unwrap_or_default()
21535 }
21536}
21537impl Default for ODOMETRY_DATA {
21538 fn default() -> Self {
21539 Self::DEFAULT.clone()
21540 }
21541}
21542impl MessageData for ODOMETRY_DATA {
21543 type Message = MavMessage;
21544 const ID: u32 = 331u32;
21545 const NAME: &'static str = "ODOMETRY";
21546 const EXTRA_CRC: u8 = 91u8;
21547 const ENCODED_LEN: usize = 233usize;
21548 fn deser(
21549 _version: MavlinkVersion,
21550 __input: &[u8],
21551 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21552 let avail_len = __input.len();
21553 let mut payload_buf = [0; Self::ENCODED_LEN];
21554 let mut buf = if avail_len < Self::ENCODED_LEN {
21555 payload_buf[0..avail_len].copy_from_slice(__input);
21556 Bytes::new(&payload_buf)
21557 } else {
21558 Bytes::new(__input)
21559 };
21560 let mut __struct = Self::default();
21561 __struct.time_usec = buf.get_u64_le();
21562 __struct.x = buf.get_f32_le();
21563 __struct.y = buf.get_f32_le();
21564 __struct.z = buf.get_f32_le();
21565 for v in &mut __struct.q {
21566 let val = buf.get_f32_le();
21567 *v = val;
21568 }
21569 __struct.vx = buf.get_f32_le();
21570 __struct.vy = buf.get_f32_le();
21571 __struct.vz = buf.get_f32_le();
21572 __struct.rollspeed = buf.get_f32_le();
21573 __struct.pitchspeed = buf.get_f32_le();
21574 __struct.yawspeed = buf.get_f32_le();
21575 for v in &mut __struct.pose_covariance {
21576 let val = buf.get_f32_le();
21577 *v = val;
21578 }
21579 for v in &mut __struct.velocity_covariance {
21580 let val = buf.get_f32_le();
21581 *v = val;
21582 }
21583 let tmp = buf.get_u8();
21584 __struct.frame_id =
21585 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21586 enum_type: "MavFrame",
21587 value: tmp as u64,
21588 })?;
21589 let tmp = buf.get_u8();
21590 __struct.child_frame_id =
21591 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21592 enum_type: "MavFrame",
21593 value: tmp as u64,
21594 })?;
21595 __struct.reset_counter = buf.get_u8();
21596 let tmp = buf.get_u8();
21597 __struct.estimator_type =
21598 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21599 enum_type: "MavEstimatorType",
21600 value: tmp as u64,
21601 })?;
21602 __struct.quality = buf.get_i8();
21603 Ok(__struct)
21604 }
21605 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21606 let mut __tmp = BytesMut::new(bytes);
21607 #[allow(clippy::absurd_extreme_comparisons)]
21608 #[allow(unused_comparisons)]
21609 if __tmp.remaining() < Self::ENCODED_LEN {
21610 panic!(
21611 "buffer is too small (need {} bytes, but got {})",
21612 Self::ENCODED_LEN,
21613 __tmp.remaining(),
21614 )
21615 }
21616 __tmp.put_u64_le(self.time_usec);
21617 __tmp.put_f32_le(self.x);
21618 __tmp.put_f32_le(self.y);
21619 __tmp.put_f32_le(self.z);
21620 for val in &self.q {
21621 __tmp.put_f32_le(*val);
21622 }
21623 __tmp.put_f32_le(self.vx);
21624 __tmp.put_f32_le(self.vy);
21625 __tmp.put_f32_le(self.vz);
21626 __tmp.put_f32_le(self.rollspeed);
21627 __tmp.put_f32_le(self.pitchspeed);
21628 __tmp.put_f32_le(self.yawspeed);
21629 for val in &self.pose_covariance {
21630 __tmp.put_f32_le(*val);
21631 }
21632 for val in &self.velocity_covariance {
21633 __tmp.put_f32_le(*val);
21634 }
21635 __tmp.put_u8(self.frame_id as u8);
21636 __tmp.put_u8(self.child_frame_id as u8);
21637 if matches!(version, MavlinkVersion::V2) {
21638 __tmp.put_u8(self.reset_counter);
21639 __tmp.put_u8(self.estimator_type as u8);
21640 __tmp.put_i8(self.quality);
21641 let len = __tmp.len();
21642 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21643 } else {
21644 __tmp.len()
21645 }
21646 }
21647}
21648#[doc = "Hardware status sent by an onboard computer."]
21649#[doc = ""]
21650#[doc = "ID: 390"]
21651#[derive(Debug, Clone, PartialEq)]
21652#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21653#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21654#[cfg_attr(feature = "ts", derive(TS))]
21655#[cfg_attr(feature = "ts", ts(export))]
21656pub struct ONBOARD_COMPUTER_STATUS_DATA {
21657 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21658 pub time_usec: u64,
21659 #[doc = "Time since system boot."]
21660 pub uptime: u32,
21661 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21662 pub ram_usage: u32,
21663 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21664 pub ram_total: u32,
21665 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
21666 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21667 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21668 pub storage_type: [u32; 4],
21669 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21670 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21671 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21672 pub storage_usage: [u32; 4],
21673 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21674 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21675 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21676 pub storage_total: [u32; 4],
21677 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
21678 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21679 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21680 pub link_type: [u32; 6],
21681 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
21682 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21683 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21684 pub link_tx_rate: [u32; 6],
21685 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
21686 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21687 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21688 pub link_rx_rate: [u32; 6],
21689 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
21690 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21691 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21692 pub link_tx_max: [u32; 6],
21693 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
21694 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21695 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21696 pub link_rx_max: [u32; 6],
21697 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
21698 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21699 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21700 pub fan_speed: [i16; 4],
21701 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
21702 pub mavtype: u8,
21703 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21704 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21705 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21706 pub cpu_cores: [u8; 8],
21707 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21708 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21709 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21710 pub cpu_combined: [u8; 10],
21711 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21712 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21713 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21714 pub gpu_cores: [u8; 4],
21715 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21716 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21717 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21718 pub gpu_combined: [u8; 10],
21719 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
21720 pub temperature_board: i8,
21721 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
21722 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21723 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21724 pub temperature_core: [i8; 8],
21725}
21726impl ONBOARD_COMPUTER_STATUS_DATA {
21727 pub const ENCODED_LEN: usize = 238usize;
21728 pub const DEFAULT: Self = Self {
21729 time_usec: 0_u64,
21730 uptime: 0_u32,
21731 ram_usage: 0_u32,
21732 ram_total: 0_u32,
21733 storage_type: [0_u32; 4usize],
21734 storage_usage: [0_u32; 4usize],
21735 storage_total: [0_u32; 4usize],
21736 link_type: [0_u32; 6usize],
21737 link_tx_rate: [0_u32; 6usize],
21738 link_rx_rate: [0_u32; 6usize],
21739 link_tx_max: [0_u32; 6usize],
21740 link_rx_max: [0_u32; 6usize],
21741 fan_speed: [0_i16; 4usize],
21742 mavtype: 0_u8,
21743 cpu_cores: [0_u8; 8usize],
21744 cpu_combined: [0_u8; 10usize],
21745 gpu_cores: [0_u8; 4usize],
21746 gpu_combined: [0_u8; 10usize],
21747 temperature_board: 0_i8,
21748 temperature_core: [0_i8; 8usize],
21749 };
21750 #[cfg(feature = "arbitrary")]
21751 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21752 use arbitrary::{Arbitrary, Unstructured};
21753 let mut buf = [0u8; 1024];
21754 rng.fill_bytes(&mut buf);
21755 let mut unstructured = Unstructured::new(&buf);
21756 Self::arbitrary(&mut unstructured).unwrap_or_default()
21757 }
21758}
21759impl Default for ONBOARD_COMPUTER_STATUS_DATA {
21760 fn default() -> Self {
21761 Self::DEFAULT.clone()
21762 }
21763}
21764impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
21765 type Message = MavMessage;
21766 const ID: u32 = 390u32;
21767 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
21768 const EXTRA_CRC: u8 = 156u8;
21769 const ENCODED_LEN: usize = 238usize;
21770 fn deser(
21771 _version: MavlinkVersion,
21772 __input: &[u8],
21773 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21774 let avail_len = __input.len();
21775 let mut payload_buf = [0; Self::ENCODED_LEN];
21776 let mut buf = if avail_len < Self::ENCODED_LEN {
21777 payload_buf[0..avail_len].copy_from_slice(__input);
21778 Bytes::new(&payload_buf)
21779 } else {
21780 Bytes::new(__input)
21781 };
21782 let mut __struct = Self::default();
21783 __struct.time_usec = buf.get_u64_le();
21784 __struct.uptime = buf.get_u32_le();
21785 __struct.ram_usage = buf.get_u32_le();
21786 __struct.ram_total = buf.get_u32_le();
21787 for v in &mut __struct.storage_type {
21788 let val = buf.get_u32_le();
21789 *v = val;
21790 }
21791 for v in &mut __struct.storage_usage {
21792 let val = buf.get_u32_le();
21793 *v = val;
21794 }
21795 for v in &mut __struct.storage_total {
21796 let val = buf.get_u32_le();
21797 *v = val;
21798 }
21799 for v in &mut __struct.link_type {
21800 let val = buf.get_u32_le();
21801 *v = val;
21802 }
21803 for v in &mut __struct.link_tx_rate {
21804 let val = buf.get_u32_le();
21805 *v = val;
21806 }
21807 for v in &mut __struct.link_rx_rate {
21808 let val = buf.get_u32_le();
21809 *v = val;
21810 }
21811 for v in &mut __struct.link_tx_max {
21812 let val = buf.get_u32_le();
21813 *v = val;
21814 }
21815 for v in &mut __struct.link_rx_max {
21816 let val = buf.get_u32_le();
21817 *v = val;
21818 }
21819 for v in &mut __struct.fan_speed {
21820 let val = buf.get_i16_le();
21821 *v = val;
21822 }
21823 __struct.mavtype = buf.get_u8();
21824 for v in &mut __struct.cpu_cores {
21825 let val = buf.get_u8();
21826 *v = val;
21827 }
21828 for v in &mut __struct.cpu_combined {
21829 let val = buf.get_u8();
21830 *v = val;
21831 }
21832 for v in &mut __struct.gpu_cores {
21833 let val = buf.get_u8();
21834 *v = val;
21835 }
21836 for v in &mut __struct.gpu_combined {
21837 let val = buf.get_u8();
21838 *v = val;
21839 }
21840 __struct.temperature_board = buf.get_i8();
21841 for v in &mut __struct.temperature_core {
21842 let val = buf.get_i8();
21843 *v = val;
21844 }
21845 Ok(__struct)
21846 }
21847 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21848 let mut __tmp = BytesMut::new(bytes);
21849 #[allow(clippy::absurd_extreme_comparisons)]
21850 #[allow(unused_comparisons)]
21851 if __tmp.remaining() < Self::ENCODED_LEN {
21852 panic!(
21853 "buffer is too small (need {} bytes, but got {})",
21854 Self::ENCODED_LEN,
21855 __tmp.remaining(),
21856 )
21857 }
21858 __tmp.put_u64_le(self.time_usec);
21859 __tmp.put_u32_le(self.uptime);
21860 __tmp.put_u32_le(self.ram_usage);
21861 __tmp.put_u32_le(self.ram_total);
21862 for val in &self.storage_type {
21863 __tmp.put_u32_le(*val);
21864 }
21865 for val in &self.storage_usage {
21866 __tmp.put_u32_le(*val);
21867 }
21868 for val in &self.storage_total {
21869 __tmp.put_u32_le(*val);
21870 }
21871 for val in &self.link_type {
21872 __tmp.put_u32_le(*val);
21873 }
21874 for val in &self.link_tx_rate {
21875 __tmp.put_u32_le(*val);
21876 }
21877 for val in &self.link_rx_rate {
21878 __tmp.put_u32_le(*val);
21879 }
21880 for val in &self.link_tx_max {
21881 __tmp.put_u32_le(*val);
21882 }
21883 for val in &self.link_rx_max {
21884 __tmp.put_u32_le(*val);
21885 }
21886 for val in &self.fan_speed {
21887 __tmp.put_i16_le(*val);
21888 }
21889 __tmp.put_u8(self.mavtype);
21890 for val in &self.cpu_cores {
21891 __tmp.put_u8(*val);
21892 }
21893 for val in &self.cpu_combined {
21894 __tmp.put_u8(*val);
21895 }
21896 for val in &self.gpu_cores {
21897 __tmp.put_u8(*val);
21898 }
21899 for val in &self.gpu_combined {
21900 __tmp.put_u8(*val);
21901 }
21902 __tmp.put_i8(self.temperature_board);
21903 for val in &self.temperature_core {
21904 __tmp.put_i8(*val);
21905 }
21906 if matches!(version, MavlinkVersion::V2) {
21907 let len = __tmp.len();
21908 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21909 } else {
21910 __tmp.len()
21911 }
21912 }
21913}
21914#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
21915#[doc = ""]
21916#[doc = "ID: 12918"]
21917#[derive(Debug, Clone, PartialEq)]
21918#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21919#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21920#[cfg_attr(feature = "ts", derive(TS))]
21921#[cfg_attr(feature = "ts", ts(export))]
21922pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
21923 #[doc = "Status level indicating if arming is allowed."]
21924 pub status: MavOdidArmStatus,
21925 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
21926 #[cfg_attr(feature = "ts", ts(type = "string"))]
21927 pub error: CharArray<50>,
21928}
21929impl OPEN_DRONE_ID_ARM_STATUS_DATA {
21930 pub const ENCODED_LEN: usize = 51usize;
21931 pub const DEFAULT: Self = Self {
21932 status: MavOdidArmStatus::DEFAULT,
21933 error: CharArray::new([0_u8; 50usize]),
21934 };
21935 #[cfg(feature = "arbitrary")]
21936 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21937 use arbitrary::{Arbitrary, Unstructured};
21938 let mut buf = [0u8; 1024];
21939 rng.fill_bytes(&mut buf);
21940 let mut unstructured = Unstructured::new(&buf);
21941 Self::arbitrary(&mut unstructured).unwrap_or_default()
21942 }
21943}
21944impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
21945 fn default() -> Self {
21946 Self::DEFAULT.clone()
21947 }
21948}
21949impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
21950 type Message = MavMessage;
21951 const ID: u32 = 12918u32;
21952 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
21953 const EXTRA_CRC: u8 = 139u8;
21954 const ENCODED_LEN: usize = 51usize;
21955 fn deser(
21956 _version: MavlinkVersion,
21957 __input: &[u8],
21958 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21959 let avail_len = __input.len();
21960 let mut payload_buf = [0; Self::ENCODED_LEN];
21961 let mut buf = if avail_len < Self::ENCODED_LEN {
21962 payload_buf[0..avail_len].copy_from_slice(__input);
21963 Bytes::new(&payload_buf)
21964 } else {
21965 Bytes::new(__input)
21966 };
21967 let mut __struct = Self::default();
21968 let tmp = buf.get_u8();
21969 __struct.status =
21970 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21971 enum_type: "MavOdidArmStatus",
21972 value: tmp as u64,
21973 })?;
21974 let mut tmp = [0_u8; 50usize];
21975 for v in &mut tmp {
21976 *v = buf.get_u8();
21977 }
21978 __struct.error = CharArray::new(tmp);
21979 Ok(__struct)
21980 }
21981 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21982 let mut __tmp = BytesMut::new(bytes);
21983 #[allow(clippy::absurd_extreme_comparisons)]
21984 #[allow(unused_comparisons)]
21985 if __tmp.remaining() < Self::ENCODED_LEN {
21986 panic!(
21987 "buffer is too small (need {} bytes, but got {})",
21988 Self::ENCODED_LEN,
21989 __tmp.remaining(),
21990 )
21991 }
21992 __tmp.put_u8(self.status as u8);
21993 for val in &self.error {
21994 __tmp.put_u8(*val);
21995 }
21996 if matches!(version, MavlinkVersion::V2) {
21997 let len = __tmp.len();
21998 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21999 } else {
22000 __tmp.len()
22001 }
22002 }
22003}
22004#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
22005#[doc = ""]
22006#[doc = "ID: 12902"]
22007#[derive(Debug, Clone, PartialEq)]
22008#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22009#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22010#[cfg_attr(feature = "ts", derive(TS))]
22011#[cfg_attr(feature = "ts", ts(export))]
22012pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
22013 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22014 pub timestamp: u32,
22015 #[doc = "System ID (0 for broadcast)."]
22016 pub target_system: u8,
22017 #[doc = "Component ID (0 for broadcast)."]
22018 pub target_component: u8,
22019 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22020 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22021 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22022 pub id_or_mac: [u8; 20],
22023 #[doc = "Indicates the type of authentication."]
22024 pub authentication_type: MavOdidAuthType,
22025 #[doc = "Allowed range is 0 - 15."]
22026 pub data_page: u8,
22027 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
22028 pub last_page_index: u8,
22029 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
22030 pub length: u8,
22031 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
22032 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22033 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22034 pub authentication_data: [u8; 23],
22035}
22036impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
22037 pub const ENCODED_LEN: usize = 53usize;
22038 pub const DEFAULT: Self = Self {
22039 timestamp: 0_u32,
22040 target_system: 0_u8,
22041 target_component: 0_u8,
22042 id_or_mac: [0_u8; 20usize],
22043 authentication_type: MavOdidAuthType::DEFAULT,
22044 data_page: 0_u8,
22045 last_page_index: 0_u8,
22046 length: 0_u8,
22047 authentication_data: [0_u8; 23usize],
22048 };
22049 #[cfg(feature = "arbitrary")]
22050 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22051 use arbitrary::{Arbitrary, Unstructured};
22052 let mut buf = [0u8; 1024];
22053 rng.fill_bytes(&mut buf);
22054 let mut unstructured = Unstructured::new(&buf);
22055 Self::arbitrary(&mut unstructured).unwrap_or_default()
22056 }
22057}
22058impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
22059 fn default() -> Self {
22060 Self::DEFAULT.clone()
22061 }
22062}
22063impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
22064 type Message = MavMessage;
22065 const ID: u32 = 12902u32;
22066 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
22067 const EXTRA_CRC: u8 = 140u8;
22068 const ENCODED_LEN: usize = 53usize;
22069 fn deser(
22070 _version: MavlinkVersion,
22071 __input: &[u8],
22072 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22073 let avail_len = __input.len();
22074 let mut payload_buf = [0; Self::ENCODED_LEN];
22075 let mut buf = if avail_len < Self::ENCODED_LEN {
22076 payload_buf[0..avail_len].copy_from_slice(__input);
22077 Bytes::new(&payload_buf)
22078 } else {
22079 Bytes::new(__input)
22080 };
22081 let mut __struct = Self::default();
22082 __struct.timestamp = buf.get_u32_le();
22083 __struct.target_system = buf.get_u8();
22084 __struct.target_component = buf.get_u8();
22085 for v in &mut __struct.id_or_mac {
22086 let val = buf.get_u8();
22087 *v = val;
22088 }
22089 let tmp = buf.get_u8();
22090 __struct.authentication_type =
22091 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22092 enum_type: "MavOdidAuthType",
22093 value: tmp as u64,
22094 })?;
22095 __struct.data_page = buf.get_u8();
22096 __struct.last_page_index = buf.get_u8();
22097 __struct.length = buf.get_u8();
22098 for v in &mut __struct.authentication_data {
22099 let val = buf.get_u8();
22100 *v = val;
22101 }
22102 Ok(__struct)
22103 }
22104 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22105 let mut __tmp = BytesMut::new(bytes);
22106 #[allow(clippy::absurd_extreme_comparisons)]
22107 #[allow(unused_comparisons)]
22108 if __tmp.remaining() < Self::ENCODED_LEN {
22109 panic!(
22110 "buffer is too small (need {} bytes, but got {})",
22111 Self::ENCODED_LEN,
22112 __tmp.remaining(),
22113 )
22114 }
22115 __tmp.put_u32_le(self.timestamp);
22116 __tmp.put_u8(self.target_system);
22117 __tmp.put_u8(self.target_component);
22118 for val in &self.id_or_mac {
22119 __tmp.put_u8(*val);
22120 }
22121 __tmp.put_u8(self.authentication_type as u8);
22122 __tmp.put_u8(self.data_page);
22123 __tmp.put_u8(self.last_page_index);
22124 __tmp.put_u8(self.length);
22125 for val in &self.authentication_data {
22126 __tmp.put_u8(*val);
22127 }
22128 if matches!(version, MavlinkVersion::V2) {
22129 let len = __tmp.len();
22130 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22131 } else {
22132 __tmp.len()
22133 }
22134 }
22135}
22136#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
22137#[doc = ""]
22138#[doc = "ID: 12900"]
22139#[derive(Debug, Clone, PartialEq)]
22140#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22141#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22142#[cfg_attr(feature = "ts", derive(TS))]
22143#[cfg_attr(feature = "ts", ts(export))]
22144pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
22145 #[doc = "System ID (0 for broadcast)."]
22146 pub target_system: u8,
22147 #[doc = "Component ID (0 for broadcast)."]
22148 pub target_component: u8,
22149 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22150 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22151 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22152 pub id_or_mac: [u8; 20],
22153 #[doc = "Indicates the format for the uas_id field of this message."]
22154 pub id_type: MavOdidIdType,
22155 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
22156 pub ua_type: MavOdidUaType,
22157 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
22158 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22159 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22160 pub uas_id: [u8; 20],
22161}
22162impl OPEN_DRONE_ID_BASIC_ID_DATA {
22163 pub const ENCODED_LEN: usize = 44usize;
22164 pub const DEFAULT: Self = Self {
22165 target_system: 0_u8,
22166 target_component: 0_u8,
22167 id_or_mac: [0_u8; 20usize],
22168 id_type: MavOdidIdType::DEFAULT,
22169 ua_type: MavOdidUaType::DEFAULT,
22170 uas_id: [0_u8; 20usize],
22171 };
22172 #[cfg(feature = "arbitrary")]
22173 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22174 use arbitrary::{Arbitrary, Unstructured};
22175 let mut buf = [0u8; 1024];
22176 rng.fill_bytes(&mut buf);
22177 let mut unstructured = Unstructured::new(&buf);
22178 Self::arbitrary(&mut unstructured).unwrap_or_default()
22179 }
22180}
22181impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
22182 fn default() -> Self {
22183 Self::DEFAULT.clone()
22184 }
22185}
22186impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
22187 type Message = MavMessage;
22188 const ID: u32 = 12900u32;
22189 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
22190 const EXTRA_CRC: u8 = 114u8;
22191 const ENCODED_LEN: usize = 44usize;
22192 fn deser(
22193 _version: MavlinkVersion,
22194 __input: &[u8],
22195 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22196 let avail_len = __input.len();
22197 let mut payload_buf = [0; Self::ENCODED_LEN];
22198 let mut buf = if avail_len < Self::ENCODED_LEN {
22199 payload_buf[0..avail_len].copy_from_slice(__input);
22200 Bytes::new(&payload_buf)
22201 } else {
22202 Bytes::new(__input)
22203 };
22204 let mut __struct = Self::default();
22205 __struct.target_system = buf.get_u8();
22206 __struct.target_component = buf.get_u8();
22207 for v in &mut __struct.id_or_mac {
22208 let val = buf.get_u8();
22209 *v = val;
22210 }
22211 let tmp = buf.get_u8();
22212 __struct.id_type =
22213 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22214 enum_type: "MavOdidIdType",
22215 value: tmp as u64,
22216 })?;
22217 let tmp = buf.get_u8();
22218 __struct.ua_type =
22219 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22220 enum_type: "MavOdidUaType",
22221 value: tmp as u64,
22222 })?;
22223 for v in &mut __struct.uas_id {
22224 let val = buf.get_u8();
22225 *v = val;
22226 }
22227 Ok(__struct)
22228 }
22229 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22230 let mut __tmp = BytesMut::new(bytes);
22231 #[allow(clippy::absurd_extreme_comparisons)]
22232 #[allow(unused_comparisons)]
22233 if __tmp.remaining() < Self::ENCODED_LEN {
22234 panic!(
22235 "buffer is too small (need {} bytes, but got {})",
22236 Self::ENCODED_LEN,
22237 __tmp.remaining(),
22238 )
22239 }
22240 __tmp.put_u8(self.target_system);
22241 __tmp.put_u8(self.target_component);
22242 for val in &self.id_or_mac {
22243 __tmp.put_u8(*val);
22244 }
22245 __tmp.put_u8(self.id_type as u8);
22246 __tmp.put_u8(self.ua_type as u8);
22247 for val in &self.uas_id {
22248 __tmp.put_u8(*val);
22249 }
22250 if matches!(version, MavlinkVersion::V2) {
22251 let len = __tmp.len();
22252 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22253 } else {
22254 __tmp.len()
22255 }
22256 }
22257}
22258#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
22259#[doc = ""]
22260#[doc = "ID: 12901"]
22261#[derive(Debug, Clone, PartialEq)]
22262#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22263#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22264#[cfg_attr(feature = "ts", derive(TS))]
22265#[cfg_attr(feature = "ts", ts(export))]
22266pub struct OPEN_DRONE_ID_LOCATION_DATA {
22267 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22268 pub latitude: i32,
22269 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22270 pub longitude: i32,
22271 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
22272 pub altitude_barometric: f32,
22273 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
22274 pub altitude_geodetic: f32,
22275 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
22276 pub height: f32,
22277 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
22278 pub timestamp: f32,
22279 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
22280 pub direction: u16,
22281 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
22282 pub speed_horizontal: u16,
22283 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
22284 pub speed_vertical: i16,
22285 #[doc = "System ID (0 for broadcast)."]
22286 pub target_system: u8,
22287 #[doc = "Component ID (0 for broadcast)."]
22288 pub target_component: u8,
22289 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22290 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22291 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22292 pub id_or_mac: [u8; 20],
22293 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
22294 pub status: MavOdidStatus,
22295 #[doc = "Indicates the reference point for the height field."]
22296 pub height_reference: MavOdidHeightRef,
22297 #[doc = "The accuracy of the horizontal position."]
22298 pub horizontal_accuracy: MavOdidHorAcc,
22299 #[doc = "The accuracy of the vertical position."]
22300 pub vertical_accuracy: MavOdidVerAcc,
22301 #[doc = "The accuracy of the barometric altitude."]
22302 pub barometer_accuracy: MavOdidVerAcc,
22303 #[doc = "The accuracy of the horizontal and vertical speed."]
22304 pub speed_accuracy: MavOdidSpeedAcc,
22305 #[doc = "The accuracy of the timestamps."]
22306 pub timestamp_accuracy: MavOdidTimeAcc,
22307}
22308impl OPEN_DRONE_ID_LOCATION_DATA {
22309 pub const ENCODED_LEN: usize = 59usize;
22310 pub const DEFAULT: Self = Self {
22311 latitude: 0_i32,
22312 longitude: 0_i32,
22313 altitude_barometric: 0.0_f32,
22314 altitude_geodetic: 0.0_f32,
22315 height: 0.0_f32,
22316 timestamp: 0.0_f32,
22317 direction: 0_u16,
22318 speed_horizontal: 0_u16,
22319 speed_vertical: 0_i16,
22320 target_system: 0_u8,
22321 target_component: 0_u8,
22322 id_or_mac: [0_u8; 20usize],
22323 status: MavOdidStatus::DEFAULT,
22324 height_reference: MavOdidHeightRef::DEFAULT,
22325 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
22326 vertical_accuracy: MavOdidVerAcc::DEFAULT,
22327 barometer_accuracy: MavOdidVerAcc::DEFAULT,
22328 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
22329 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
22330 };
22331 #[cfg(feature = "arbitrary")]
22332 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22333 use arbitrary::{Arbitrary, Unstructured};
22334 let mut buf = [0u8; 1024];
22335 rng.fill_bytes(&mut buf);
22336 let mut unstructured = Unstructured::new(&buf);
22337 Self::arbitrary(&mut unstructured).unwrap_or_default()
22338 }
22339}
22340impl Default for OPEN_DRONE_ID_LOCATION_DATA {
22341 fn default() -> Self {
22342 Self::DEFAULT.clone()
22343 }
22344}
22345impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
22346 type Message = MavMessage;
22347 const ID: u32 = 12901u32;
22348 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
22349 const EXTRA_CRC: u8 = 254u8;
22350 const ENCODED_LEN: usize = 59usize;
22351 fn deser(
22352 _version: MavlinkVersion,
22353 __input: &[u8],
22354 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22355 let avail_len = __input.len();
22356 let mut payload_buf = [0; Self::ENCODED_LEN];
22357 let mut buf = if avail_len < Self::ENCODED_LEN {
22358 payload_buf[0..avail_len].copy_from_slice(__input);
22359 Bytes::new(&payload_buf)
22360 } else {
22361 Bytes::new(__input)
22362 };
22363 let mut __struct = Self::default();
22364 __struct.latitude = buf.get_i32_le();
22365 __struct.longitude = buf.get_i32_le();
22366 __struct.altitude_barometric = buf.get_f32_le();
22367 __struct.altitude_geodetic = buf.get_f32_le();
22368 __struct.height = buf.get_f32_le();
22369 __struct.timestamp = buf.get_f32_le();
22370 __struct.direction = buf.get_u16_le();
22371 __struct.speed_horizontal = buf.get_u16_le();
22372 __struct.speed_vertical = buf.get_i16_le();
22373 __struct.target_system = buf.get_u8();
22374 __struct.target_component = buf.get_u8();
22375 for v in &mut __struct.id_or_mac {
22376 let val = buf.get_u8();
22377 *v = val;
22378 }
22379 let tmp = buf.get_u8();
22380 __struct.status =
22381 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22382 enum_type: "MavOdidStatus",
22383 value: tmp as u64,
22384 })?;
22385 let tmp = buf.get_u8();
22386 __struct.height_reference =
22387 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22388 enum_type: "MavOdidHeightRef",
22389 value: tmp as u64,
22390 })?;
22391 let tmp = buf.get_u8();
22392 __struct.horizontal_accuracy =
22393 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22394 enum_type: "MavOdidHorAcc",
22395 value: tmp as u64,
22396 })?;
22397 let tmp = buf.get_u8();
22398 __struct.vertical_accuracy =
22399 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22400 enum_type: "MavOdidVerAcc",
22401 value: tmp as u64,
22402 })?;
22403 let tmp = buf.get_u8();
22404 __struct.barometer_accuracy =
22405 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22406 enum_type: "MavOdidVerAcc",
22407 value: tmp as u64,
22408 })?;
22409 let tmp = buf.get_u8();
22410 __struct.speed_accuracy =
22411 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22412 enum_type: "MavOdidSpeedAcc",
22413 value: tmp as u64,
22414 })?;
22415 let tmp = buf.get_u8();
22416 __struct.timestamp_accuracy =
22417 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22418 enum_type: "MavOdidTimeAcc",
22419 value: tmp as u64,
22420 })?;
22421 Ok(__struct)
22422 }
22423 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22424 let mut __tmp = BytesMut::new(bytes);
22425 #[allow(clippy::absurd_extreme_comparisons)]
22426 #[allow(unused_comparisons)]
22427 if __tmp.remaining() < Self::ENCODED_LEN {
22428 panic!(
22429 "buffer is too small (need {} bytes, but got {})",
22430 Self::ENCODED_LEN,
22431 __tmp.remaining(),
22432 )
22433 }
22434 __tmp.put_i32_le(self.latitude);
22435 __tmp.put_i32_le(self.longitude);
22436 __tmp.put_f32_le(self.altitude_barometric);
22437 __tmp.put_f32_le(self.altitude_geodetic);
22438 __tmp.put_f32_le(self.height);
22439 __tmp.put_f32_le(self.timestamp);
22440 __tmp.put_u16_le(self.direction);
22441 __tmp.put_u16_le(self.speed_horizontal);
22442 __tmp.put_i16_le(self.speed_vertical);
22443 __tmp.put_u8(self.target_system);
22444 __tmp.put_u8(self.target_component);
22445 for val in &self.id_or_mac {
22446 __tmp.put_u8(*val);
22447 }
22448 __tmp.put_u8(self.status as u8);
22449 __tmp.put_u8(self.height_reference as u8);
22450 __tmp.put_u8(self.horizontal_accuracy as u8);
22451 __tmp.put_u8(self.vertical_accuracy as u8);
22452 __tmp.put_u8(self.barometer_accuracy as u8);
22453 __tmp.put_u8(self.speed_accuracy as u8);
22454 __tmp.put_u8(self.timestamp_accuracy as u8);
22455 if matches!(version, MavlinkVersion::V2) {
22456 let len = __tmp.len();
22457 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22458 } else {
22459 __tmp.len()
22460 }
22461 }
22462}
22463#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
22464#[doc = ""]
22465#[doc = "ID: 12915"]
22466#[derive(Debug, Clone, PartialEq)]
22467#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22468#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22469#[cfg_attr(feature = "ts", derive(TS))]
22470#[cfg_attr(feature = "ts", ts(export))]
22471pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22472 #[doc = "System ID (0 for broadcast)."]
22473 pub target_system: u8,
22474 #[doc = "Component ID (0 for broadcast)."]
22475 pub target_component: u8,
22476 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22477 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22478 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22479 pub id_or_mac: [u8; 20],
22480 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
22481 pub single_message_size: u8,
22482 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
22483 pub msg_pack_size: u8,
22484 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
22485 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22486 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22487 pub messages: [u8; 225],
22488}
22489impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22490 pub const ENCODED_LEN: usize = 249usize;
22491 pub const DEFAULT: Self = Self {
22492 target_system: 0_u8,
22493 target_component: 0_u8,
22494 id_or_mac: [0_u8; 20usize],
22495 single_message_size: 0_u8,
22496 msg_pack_size: 0_u8,
22497 messages: [0_u8; 225usize],
22498 };
22499 #[cfg(feature = "arbitrary")]
22500 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22501 use arbitrary::{Arbitrary, Unstructured};
22502 let mut buf = [0u8; 1024];
22503 rng.fill_bytes(&mut buf);
22504 let mut unstructured = Unstructured::new(&buf);
22505 Self::arbitrary(&mut unstructured).unwrap_or_default()
22506 }
22507}
22508impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22509 fn default() -> Self {
22510 Self::DEFAULT.clone()
22511 }
22512}
22513impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22514 type Message = MavMessage;
22515 const ID: u32 = 12915u32;
22516 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
22517 const EXTRA_CRC: u8 = 94u8;
22518 const ENCODED_LEN: usize = 249usize;
22519 fn deser(
22520 _version: MavlinkVersion,
22521 __input: &[u8],
22522 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22523 let avail_len = __input.len();
22524 let mut payload_buf = [0; Self::ENCODED_LEN];
22525 let mut buf = if avail_len < Self::ENCODED_LEN {
22526 payload_buf[0..avail_len].copy_from_slice(__input);
22527 Bytes::new(&payload_buf)
22528 } else {
22529 Bytes::new(__input)
22530 };
22531 let mut __struct = Self::default();
22532 __struct.target_system = buf.get_u8();
22533 __struct.target_component = buf.get_u8();
22534 for v in &mut __struct.id_or_mac {
22535 let val = buf.get_u8();
22536 *v = val;
22537 }
22538 __struct.single_message_size = buf.get_u8();
22539 __struct.msg_pack_size = buf.get_u8();
22540 for v in &mut __struct.messages {
22541 let val = buf.get_u8();
22542 *v = val;
22543 }
22544 Ok(__struct)
22545 }
22546 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22547 let mut __tmp = BytesMut::new(bytes);
22548 #[allow(clippy::absurd_extreme_comparisons)]
22549 #[allow(unused_comparisons)]
22550 if __tmp.remaining() < Self::ENCODED_LEN {
22551 panic!(
22552 "buffer is too small (need {} bytes, but got {})",
22553 Self::ENCODED_LEN,
22554 __tmp.remaining(),
22555 )
22556 }
22557 __tmp.put_u8(self.target_system);
22558 __tmp.put_u8(self.target_component);
22559 for val in &self.id_or_mac {
22560 __tmp.put_u8(*val);
22561 }
22562 __tmp.put_u8(self.single_message_size);
22563 __tmp.put_u8(self.msg_pack_size);
22564 for val in &self.messages {
22565 __tmp.put_u8(*val);
22566 }
22567 if matches!(version, MavlinkVersion::V2) {
22568 let len = __tmp.len();
22569 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22570 } else {
22571 __tmp.len()
22572 }
22573 }
22574}
22575#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
22576#[doc = ""]
22577#[doc = "ID: 12905"]
22578#[derive(Debug, Clone, PartialEq)]
22579#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22581#[cfg_attr(feature = "ts", derive(TS))]
22582#[cfg_attr(feature = "ts", ts(export))]
22583pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
22584 #[doc = "System ID (0 for broadcast)."]
22585 pub target_system: u8,
22586 #[doc = "Component ID (0 for broadcast)."]
22587 pub target_component: u8,
22588 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22589 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22590 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22591 pub id_or_mac: [u8; 20],
22592 #[doc = "Indicates the type of the operator_id field."]
22593 pub operator_id_type: MavOdidOperatorIdType,
22594 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22595 #[cfg_attr(feature = "ts", ts(type = "string"))]
22596 pub operator_id: CharArray<20>,
22597}
22598impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
22599 pub const ENCODED_LEN: usize = 43usize;
22600 pub const DEFAULT: Self = Self {
22601 target_system: 0_u8,
22602 target_component: 0_u8,
22603 id_or_mac: [0_u8; 20usize],
22604 operator_id_type: MavOdidOperatorIdType::DEFAULT,
22605 operator_id: CharArray::new([0_u8; 20usize]),
22606 };
22607 #[cfg(feature = "arbitrary")]
22608 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22609 use arbitrary::{Arbitrary, Unstructured};
22610 let mut buf = [0u8; 1024];
22611 rng.fill_bytes(&mut buf);
22612 let mut unstructured = Unstructured::new(&buf);
22613 Self::arbitrary(&mut unstructured).unwrap_or_default()
22614 }
22615}
22616impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22617 fn default() -> Self {
22618 Self::DEFAULT.clone()
22619 }
22620}
22621impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22622 type Message = MavMessage;
22623 const ID: u32 = 12905u32;
22624 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
22625 const EXTRA_CRC: u8 = 49u8;
22626 const ENCODED_LEN: usize = 43usize;
22627 fn deser(
22628 _version: MavlinkVersion,
22629 __input: &[u8],
22630 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22631 let avail_len = __input.len();
22632 let mut payload_buf = [0; Self::ENCODED_LEN];
22633 let mut buf = if avail_len < Self::ENCODED_LEN {
22634 payload_buf[0..avail_len].copy_from_slice(__input);
22635 Bytes::new(&payload_buf)
22636 } else {
22637 Bytes::new(__input)
22638 };
22639 let mut __struct = Self::default();
22640 __struct.target_system = buf.get_u8();
22641 __struct.target_component = buf.get_u8();
22642 for v in &mut __struct.id_or_mac {
22643 let val = buf.get_u8();
22644 *v = val;
22645 }
22646 let tmp = buf.get_u8();
22647 __struct.operator_id_type =
22648 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22649 enum_type: "MavOdidOperatorIdType",
22650 value: tmp as u64,
22651 })?;
22652 let mut tmp = [0_u8; 20usize];
22653 for v in &mut tmp {
22654 *v = buf.get_u8();
22655 }
22656 __struct.operator_id = CharArray::new(tmp);
22657 Ok(__struct)
22658 }
22659 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22660 let mut __tmp = BytesMut::new(bytes);
22661 #[allow(clippy::absurd_extreme_comparisons)]
22662 #[allow(unused_comparisons)]
22663 if __tmp.remaining() < Self::ENCODED_LEN {
22664 panic!(
22665 "buffer is too small (need {} bytes, but got {})",
22666 Self::ENCODED_LEN,
22667 __tmp.remaining(),
22668 )
22669 }
22670 __tmp.put_u8(self.target_system);
22671 __tmp.put_u8(self.target_component);
22672 for val in &self.id_or_mac {
22673 __tmp.put_u8(*val);
22674 }
22675 __tmp.put_u8(self.operator_id_type as u8);
22676 for val in &self.operator_id {
22677 __tmp.put_u8(*val);
22678 }
22679 if matches!(version, MavlinkVersion::V2) {
22680 let len = __tmp.len();
22681 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22682 } else {
22683 __tmp.len()
22684 }
22685 }
22686}
22687#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
22688#[doc = ""]
22689#[doc = "ID: 12903"]
22690#[derive(Debug, Clone, PartialEq)]
22691#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22692#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22693#[cfg_attr(feature = "ts", derive(TS))]
22694#[cfg_attr(feature = "ts", ts(export))]
22695pub struct OPEN_DRONE_ID_SELF_ID_DATA {
22696 #[doc = "System ID (0 for broadcast)."]
22697 pub target_system: u8,
22698 #[doc = "Component ID (0 for broadcast)."]
22699 pub target_component: u8,
22700 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22701 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22702 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22703 pub id_or_mac: [u8; 20],
22704 #[doc = "Indicates the type of the description field."]
22705 pub description_type: MavOdidDescType,
22706 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22707 #[cfg_attr(feature = "ts", ts(type = "string"))]
22708 pub description: CharArray<23>,
22709}
22710impl OPEN_DRONE_ID_SELF_ID_DATA {
22711 pub const ENCODED_LEN: usize = 46usize;
22712 pub const DEFAULT: Self = Self {
22713 target_system: 0_u8,
22714 target_component: 0_u8,
22715 id_or_mac: [0_u8; 20usize],
22716 description_type: MavOdidDescType::DEFAULT,
22717 description: CharArray::new([0_u8; 23usize]),
22718 };
22719 #[cfg(feature = "arbitrary")]
22720 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22721 use arbitrary::{Arbitrary, Unstructured};
22722 let mut buf = [0u8; 1024];
22723 rng.fill_bytes(&mut buf);
22724 let mut unstructured = Unstructured::new(&buf);
22725 Self::arbitrary(&mut unstructured).unwrap_or_default()
22726 }
22727}
22728impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
22729 fn default() -> Self {
22730 Self::DEFAULT.clone()
22731 }
22732}
22733impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
22734 type Message = MavMessage;
22735 const ID: u32 = 12903u32;
22736 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
22737 const EXTRA_CRC: u8 = 249u8;
22738 const ENCODED_LEN: usize = 46usize;
22739 fn deser(
22740 _version: MavlinkVersion,
22741 __input: &[u8],
22742 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22743 let avail_len = __input.len();
22744 let mut payload_buf = [0; Self::ENCODED_LEN];
22745 let mut buf = if avail_len < Self::ENCODED_LEN {
22746 payload_buf[0..avail_len].copy_from_slice(__input);
22747 Bytes::new(&payload_buf)
22748 } else {
22749 Bytes::new(__input)
22750 };
22751 let mut __struct = Self::default();
22752 __struct.target_system = buf.get_u8();
22753 __struct.target_component = buf.get_u8();
22754 for v in &mut __struct.id_or_mac {
22755 let val = buf.get_u8();
22756 *v = val;
22757 }
22758 let tmp = buf.get_u8();
22759 __struct.description_type =
22760 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22761 enum_type: "MavOdidDescType",
22762 value: tmp as u64,
22763 })?;
22764 let mut tmp = [0_u8; 23usize];
22765 for v in &mut tmp {
22766 *v = buf.get_u8();
22767 }
22768 __struct.description = CharArray::new(tmp);
22769 Ok(__struct)
22770 }
22771 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22772 let mut __tmp = BytesMut::new(bytes);
22773 #[allow(clippy::absurd_extreme_comparisons)]
22774 #[allow(unused_comparisons)]
22775 if __tmp.remaining() < Self::ENCODED_LEN {
22776 panic!(
22777 "buffer is too small (need {} bytes, but got {})",
22778 Self::ENCODED_LEN,
22779 __tmp.remaining(),
22780 )
22781 }
22782 __tmp.put_u8(self.target_system);
22783 __tmp.put_u8(self.target_component);
22784 for val in &self.id_or_mac {
22785 __tmp.put_u8(*val);
22786 }
22787 __tmp.put_u8(self.description_type as u8);
22788 for val in &self.description {
22789 __tmp.put_u8(*val);
22790 }
22791 if matches!(version, MavlinkVersion::V2) {
22792 let len = __tmp.len();
22793 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22794 } else {
22795 __tmp.len()
22796 }
22797 }
22798}
22799#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
22800#[doc = ""]
22801#[doc = "ID: 12904"]
22802#[derive(Debug, Clone, PartialEq)]
22803#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22804#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22805#[cfg_attr(feature = "ts", derive(TS))]
22806#[cfg_attr(feature = "ts", ts(export))]
22807pub struct OPEN_DRONE_ID_SYSTEM_DATA {
22808 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22809 pub operator_latitude: i32,
22810 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22811 pub operator_longitude: i32,
22812 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22813 pub area_ceiling: f32,
22814 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22815 pub area_floor: f32,
22816 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22817 pub operator_altitude_geo: f32,
22818 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22819 pub timestamp: u32,
22820 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
22821 pub area_count: u16,
22822 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
22823 pub area_radius: u16,
22824 #[doc = "System ID (0 for broadcast)."]
22825 pub target_system: u8,
22826 #[doc = "Component ID (0 for broadcast)."]
22827 pub target_component: u8,
22828 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22829 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22830 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22831 pub id_or_mac: [u8; 20],
22832 #[doc = "Specifies the operator location type."]
22833 pub operator_location_type: MavOdidOperatorLocationType,
22834 #[doc = "Specifies the classification type of the UA."]
22835 pub classification_type: MavOdidClassificationType,
22836 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
22837 pub category_eu: MavOdidCategoryEu,
22838 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
22839 pub class_eu: MavOdidClassEu,
22840}
22841impl OPEN_DRONE_ID_SYSTEM_DATA {
22842 pub const ENCODED_LEN: usize = 54usize;
22843 pub const DEFAULT: Self = Self {
22844 operator_latitude: 0_i32,
22845 operator_longitude: 0_i32,
22846 area_ceiling: 0.0_f32,
22847 area_floor: 0.0_f32,
22848 operator_altitude_geo: 0.0_f32,
22849 timestamp: 0_u32,
22850 area_count: 0_u16,
22851 area_radius: 0_u16,
22852 target_system: 0_u8,
22853 target_component: 0_u8,
22854 id_or_mac: [0_u8; 20usize],
22855 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
22856 classification_type: MavOdidClassificationType::DEFAULT,
22857 category_eu: MavOdidCategoryEu::DEFAULT,
22858 class_eu: MavOdidClassEu::DEFAULT,
22859 };
22860 #[cfg(feature = "arbitrary")]
22861 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22862 use arbitrary::{Arbitrary, Unstructured};
22863 let mut buf = [0u8; 1024];
22864 rng.fill_bytes(&mut buf);
22865 let mut unstructured = Unstructured::new(&buf);
22866 Self::arbitrary(&mut unstructured).unwrap_or_default()
22867 }
22868}
22869impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
22870 fn default() -> Self {
22871 Self::DEFAULT.clone()
22872 }
22873}
22874impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
22875 type Message = MavMessage;
22876 const ID: u32 = 12904u32;
22877 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
22878 const EXTRA_CRC: u8 = 77u8;
22879 const ENCODED_LEN: usize = 54usize;
22880 fn deser(
22881 _version: MavlinkVersion,
22882 __input: &[u8],
22883 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22884 let avail_len = __input.len();
22885 let mut payload_buf = [0; Self::ENCODED_LEN];
22886 let mut buf = if avail_len < Self::ENCODED_LEN {
22887 payload_buf[0..avail_len].copy_from_slice(__input);
22888 Bytes::new(&payload_buf)
22889 } else {
22890 Bytes::new(__input)
22891 };
22892 let mut __struct = Self::default();
22893 __struct.operator_latitude = buf.get_i32_le();
22894 __struct.operator_longitude = buf.get_i32_le();
22895 __struct.area_ceiling = buf.get_f32_le();
22896 __struct.area_floor = buf.get_f32_le();
22897 __struct.operator_altitude_geo = buf.get_f32_le();
22898 __struct.timestamp = buf.get_u32_le();
22899 __struct.area_count = buf.get_u16_le();
22900 __struct.area_radius = buf.get_u16_le();
22901 __struct.target_system = buf.get_u8();
22902 __struct.target_component = buf.get_u8();
22903 for v in &mut __struct.id_or_mac {
22904 let val = buf.get_u8();
22905 *v = val;
22906 }
22907 let tmp = buf.get_u8();
22908 __struct.operator_location_type =
22909 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22910 enum_type: "MavOdidOperatorLocationType",
22911 value: tmp as u64,
22912 })?;
22913 let tmp = buf.get_u8();
22914 __struct.classification_type =
22915 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22916 enum_type: "MavOdidClassificationType",
22917 value: tmp as u64,
22918 })?;
22919 let tmp = buf.get_u8();
22920 __struct.category_eu =
22921 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22922 enum_type: "MavOdidCategoryEu",
22923 value: tmp as u64,
22924 })?;
22925 let tmp = buf.get_u8();
22926 __struct.class_eu =
22927 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22928 enum_type: "MavOdidClassEu",
22929 value: tmp as u64,
22930 })?;
22931 Ok(__struct)
22932 }
22933 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22934 let mut __tmp = BytesMut::new(bytes);
22935 #[allow(clippy::absurd_extreme_comparisons)]
22936 #[allow(unused_comparisons)]
22937 if __tmp.remaining() < Self::ENCODED_LEN {
22938 panic!(
22939 "buffer is too small (need {} bytes, but got {})",
22940 Self::ENCODED_LEN,
22941 __tmp.remaining(),
22942 )
22943 }
22944 __tmp.put_i32_le(self.operator_latitude);
22945 __tmp.put_i32_le(self.operator_longitude);
22946 __tmp.put_f32_le(self.area_ceiling);
22947 __tmp.put_f32_le(self.area_floor);
22948 __tmp.put_f32_le(self.operator_altitude_geo);
22949 __tmp.put_u32_le(self.timestamp);
22950 __tmp.put_u16_le(self.area_count);
22951 __tmp.put_u16_le(self.area_radius);
22952 __tmp.put_u8(self.target_system);
22953 __tmp.put_u8(self.target_component);
22954 for val in &self.id_or_mac {
22955 __tmp.put_u8(*val);
22956 }
22957 __tmp.put_u8(self.operator_location_type as u8);
22958 __tmp.put_u8(self.classification_type as u8);
22959 __tmp.put_u8(self.category_eu as u8);
22960 __tmp.put_u8(self.class_eu as u8);
22961 if matches!(version, MavlinkVersion::V2) {
22962 let len = __tmp.len();
22963 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22964 } else {
22965 __tmp.len()
22966 }
22967 }
22968}
22969#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
22970#[doc = ""]
22971#[doc = "ID: 12919"]
22972#[derive(Debug, Clone, PartialEq)]
22973#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22974#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22975#[cfg_attr(feature = "ts", derive(TS))]
22976#[cfg_attr(feature = "ts", ts(export))]
22977pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22978 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22979 pub operator_latitude: i32,
22980 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22981 pub operator_longitude: i32,
22982 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22983 pub operator_altitude_geo: f32,
22984 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22985 pub timestamp: u32,
22986 #[doc = "System ID (0 for broadcast)."]
22987 pub target_system: u8,
22988 #[doc = "Component ID (0 for broadcast)."]
22989 pub target_component: u8,
22990}
22991impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22992 pub const ENCODED_LEN: usize = 18usize;
22993 pub const DEFAULT: Self = Self {
22994 operator_latitude: 0_i32,
22995 operator_longitude: 0_i32,
22996 operator_altitude_geo: 0.0_f32,
22997 timestamp: 0_u32,
22998 target_system: 0_u8,
22999 target_component: 0_u8,
23000 };
23001 #[cfg(feature = "arbitrary")]
23002 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23003 use arbitrary::{Arbitrary, Unstructured};
23004 let mut buf = [0u8; 1024];
23005 rng.fill_bytes(&mut buf);
23006 let mut unstructured = Unstructured::new(&buf);
23007 Self::arbitrary(&mut unstructured).unwrap_or_default()
23008 }
23009}
23010impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23011 fn default() -> Self {
23012 Self::DEFAULT.clone()
23013 }
23014}
23015impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23016 type Message = MavMessage;
23017 const ID: u32 = 12919u32;
23018 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
23019 const EXTRA_CRC: u8 = 7u8;
23020 const ENCODED_LEN: usize = 18usize;
23021 fn deser(
23022 _version: MavlinkVersion,
23023 __input: &[u8],
23024 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23025 let avail_len = __input.len();
23026 let mut payload_buf = [0; Self::ENCODED_LEN];
23027 let mut buf = if avail_len < Self::ENCODED_LEN {
23028 payload_buf[0..avail_len].copy_from_slice(__input);
23029 Bytes::new(&payload_buf)
23030 } else {
23031 Bytes::new(__input)
23032 };
23033 let mut __struct = Self::default();
23034 __struct.operator_latitude = buf.get_i32_le();
23035 __struct.operator_longitude = buf.get_i32_le();
23036 __struct.operator_altitude_geo = buf.get_f32_le();
23037 __struct.timestamp = buf.get_u32_le();
23038 __struct.target_system = buf.get_u8();
23039 __struct.target_component = buf.get_u8();
23040 Ok(__struct)
23041 }
23042 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23043 let mut __tmp = BytesMut::new(bytes);
23044 #[allow(clippy::absurd_extreme_comparisons)]
23045 #[allow(unused_comparisons)]
23046 if __tmp.remaining() < Self::ENCODED_LEN {
23047 panic!(
23048 "buffer is too small (need {} bytes, but got {})",
23049 Self::ENCODED_LEN,
23050 __tmp.remaining(),
23051 )
23052 }
23053 __tmp.put_i32_le(self.operator_latitude);
23054 __tmp.put_i32_le(self.operator_longitude);
23055 __tmp.put_f32_le(self.operator_altitude_geo);
23056 __tmp.put_u32_le(self.timestamp);
23057 __tmp.put_u8(self.target_system);
23058 __tmp.put_u8(self.target_component);
23059 if matches!(version, MavlinkVersion::V2) {
23060 let len = __tmp.len();
23061 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23062 } else {
23063 __tmp.len()
23064 }
23065 }
23066}
23067#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
23068#[doc = ""]
23069#[doc = "ID: 100"]
23070#[derive(Debug, Clone, PartialEq)]
23071#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23072#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23073#[cfg_attr(feature = "ts", derive(TS))]
23074#[cfg_attr(feature = "ts", ts(export))]
23075pub struct OPTICAL_FLOW_DATA {
23076 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23077 pub time_usec: u64,
23078 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
23079 pub flow_comp_m_x: f32,
23080 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
23081 pub flow_comp_m_y: f32,
23082 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
23083 pub ground_distance: f32,
23084 #[doc = "Flow in x-sensor direction"]
23085 pub flow_x: i16,
23086 #[doc = "Flow in y-sensor direction"]
23087 pub flow_y: i16,
23088 #[doc = "Sensor ID"]
23089 pub sensor_id: u8,
23090 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
23091 pub quality: u8,
23092 #[doc = "Flow rate about X axis"]
23093 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23094 pub flow_rate_x: f32,
23095 #[doc = "Flow rate about Y axis"]
23096 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23097 pub flow_rate_y: f32,
23098}
23099impl OPTICAL_FLOW_DATA {
23100 pub const ENCODED_LEN: usize = 34usize;
23101 pub const DEFAULT: Self = Self {
23102 time_usec: 0_u64,
23103 flow_comp_m_x: 0.0_f32,
23104 flow_comp_m_y: 0.0_f32,
23105 ground_distance: 0.0_f32,
23106 flow_x: 0_i16,
23107 flow_y: 0_i16,
23108 sensor_id: 0_u8,
23109 quality: 0_u8,
23110 flow_rate_x: 0.0_f32,
23111 flow_rate_y: 0.0_f32,
23112 };
23113 #[cfg(feature = "arbitrary")]
23114 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23115 use arbitrary::{Arbitrary, Unstructured};
23116 let mut buf = [0u8; 1024];
23117 rng.fill_bytes(&mut buf);
23118 let mut unstructured = Unstructured::new(&buf);
23119 Self::arbitrary(&mut unstructured).unwrap_or_default()
23120 }
23121}
23122impl Default for OPTICAL_FLOW_DATA {
23123 fn default() -> Self {
23124 Self::DEFAULT.clone()
23125 }
23126}
23127impl MessageData for OPTICAL_FLOW_DATA {
23128 type Message = MavMessage;
23129 const ID: u32 = 100u32;
23130 const NAME: &'static str = "OPTICAL_FLOW";
23131 const EXTRA_CRC: u8 = 175u8;
23132 const ENCODED_LEN: usize = 34usize;
23133 fn deser(
23134 _version: MavlinkVersion,
23135 __input: &[u8],
23136 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23137 let avail_len = __input.len();
23138 let mut payload_buf = [0; Self::ENCODED_LEN];
23139 let mut buf = if avail_len < Self::ENCODED_LEN {
23140 payload_buf[0..avail_len].copy_from_slice(__input);
23141 Bytes::new(&payload_buf)
23142 } else {
23143 Bytes::new(__input)
23144 };
23145 let mut __struct = Self::default();
23146 __struct.time_usec = buf.get_u64_le();
23147 __struct.flow_comp_m_x = buf.get_f32_le();
23148 __struct.flow_comp_m_y = buf.get_f32_le();
23149 __struct.ground_distance = buf.get_f32_le();
23150 __struct.flow_x = buf.get_i16_le();
23151 __struct.flow_y = buf.get_i16_le();
23152 __struct.sensor_id = buf.get_u8();
23153 __struct.quality = buf.get_u8();
23154 __struct.flow_rate_x = buf.get_f32_le();
23155 __struct.flow_rate_y = buf.get_f32_le();
23156 Ok(__struct)
23157 }
23158 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23159 let mut __tmp = BytesMut::new(bytes);
23160 #[allow(clippy::absurd_extreme_comparisons)]
23161 #[allow(unused_comparisons)]
23162 if __tmp.remaining() < Self::ENCODED_LEN {
23163 panic!(
23164 "buffer is too small (need {} bytes, but got {})",
23165 Self::ENCODED_LEN,
23166 __tmp.remaining(),
23167 )
23168 }
23169 __tmp.put_u64_le(self.time_usec);
23170 __tmp.put_f32_le(self.flow_comp_m_x);
23171 __tmp.put_f32_le(self.flow_comp_m_y);
23172 __tmp.put_f32_le(self.ground_distance);
23173 __tmp.put_i16_le(self.flow_x);
23174 __tmp.put_i16_le(self.flow_y);
23175 __tmp.put_u8(self.sensor_id);
23176 __tmp.put_u8(self.quality);
23177 if matches!(version, MavlinkVersion::V2) {
23178 __tmp.put_f32_le(self.flow_rate_x);
23179 __tmp.put_f32_le(self.flow_rate_y);
23180 let len = __tmp.len();
23181 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23182 } else {
23183 __tmp.len()
23184 }
23185 }
23186}
23187#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
23188#[doc = ""]
23189#[doc = "ID: 106"]
23190#[derive(Debug, Clone, PartialEq)]
23191#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23192#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23193#[cfg_attr(feature = "ts", derive(TS))]
23194#[cfg_attr(feature = "ts", ts(export))]
23195pub struct OPTICAL_FLOW_RAD_DATA {
23196 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23197 pub time_usec: u64,
23198 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
23199 pub integration_time_us: u32,
23200 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
23201 pub integrated_x: f32,
23202 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
23203 pub integrated_y: f32,
23204 #[doc = "RH rotation around X axis"]
23205 pub integrated_xgyro: f32,
23206 #[doc = "RH rotation around Y axis"]
23207 pub integrated_ygyro: f32,
23208 #[doc = "RH rotation around Z axis"]
23209 pub integrated_zgyro: f32,
23210 #[doc = "Time since the distance was sampled."]
23211 pub time_delta_distance_us: u32,
23212 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
23213 pub distance: f32,
23214 #[doc = "Temperature"]
23215 pub temperature: i16,
23216 #[doc = "Sensor ID"]
23217 pub sensor_id: u8,
23218 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
23219 pub quality: u8,
23220}
23221impl OPTICAL_FLOW_RAD_DATA {
23222 pub const ENCODED_LEN: usize = 44usize;
23223 pub const DEFAULT: Self = Self {
23224 time_usec: 0_u64,
23225 integration_time_us: 0_u32,
23226 integrated_x: 0.0_f32,
23227 integrated_y: 0.0_f32,
23228 integrated_xgyro: 0.0_f32,
23229 integrated_ygyro: 0.0_f32,
23230 integrated_zgyro: 0.0_f32,
23231 time_delta_distance_us: 0_u32,
23232 distance: 0.0_f32,
23233 temperature: 0_i16,
23234 sensor_id: 0_u8,
23235 quality: 0_u8,
23236 };
23237 #[cfg(feature = "arbitrary")]
23238 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23239 use arbitrary::{Arbitrary, Unstructured};
23240 let mut buf = [0u8; 1024];
23241 rng.fill_bytes(&mut buf);
23242 let mut unstructured = Unstructured::new(&buf);
23243 Self::arbitrary(&mut unstructured).unwrap_or_default()
23244 }
23245}
23246impl Default for OPTICAL_FLOW_RAD_DATA {
23247 fn default() -> Self {
23248 Self::DEFAULT.clone()
23249 }
23250}
23251impl MessageData for OPTICAL_FLOW_RAD_DATA {
23252 type Message = MavMessage;
23253 const ID: u32 = 106u32;
23254 const NAME: &'static str = "OPTICAL_FLOW_RAD";
23255 const EXTRA_CRC: u8 = 138u8;
23256 const ENCODED_LEN: usize = 44usize;
23257 fn deser(
23258 _version: MavlinkVersion,
23259 __input: &[u8],
23260 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23261 let avail_len = __input.len();
23262 let mut payload_buf = [0; Self::ENCODED_LEN];
23263 let mut buf = if avail_len < Self::ENCODED_LEN {
23264 payload_buf[0..avail_len].copy_from_slice(__input);
23265 Bytes::new(&payload_buf)
23266 } else {
23267 Bytes::new(__input)
23268 };
23269 let mut __struct = Self::default();
23270 __struct.time_usec = buf.get_u64_le();
23271 __struct.integration_time_us = buf.get_u32_le();
23272 __struct.integrated_x = buf.get_f32_le();
23273 __struct.integrated_y = buf.get_f32_le();
23274 __struct.integrated_xgyro = buf.get_f32_le();
23275 __struct.integrated_ygyro = buf.get_f32_le();
23276 __struct.integrated_zgyro = buf.get_f32_le();
23277 __struct.time_delta_distance_us = buf.get_u32_le();
23278 __struct.distance = buf.get_f32_le();
23279 __struct.temperature = buf.get_i16_le();
23280 __struct.sensor_id = buf.get_u8();
23281 __struct.quality = buf.get_u8();
23282 Ok(__struct)
23283 }
23284 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23285 let mut __tmp = BytesMut::new(bytes);
23286 #[allow(clippy::absurd_extreme_comparisons)]
23287 #[allow(unused_comparisons)]
23288 if __tmp.remaining() < Self::ENCODED_LEN {
23289 panic!(
23290 "buffer is too small (need {} bytes, but got {})",
23291 Self::ENCODED_LEN,
23292 __tmp.remaining(),
23293 )
23294 }
23295 __tmp.put_u64_le(self.time_usec);
23296 __tmp.put_u32_le(self.integration_time_us);
23297 __tmp.put_f32_le(self.integrated_x);
23298 __tmp.put_f32_le(self.integrated_y);
23299 __tmp.put_f32_le(self.integrated_xgyro);
23300 __tmp.put_f32_le(self.integrated_ygyro);
23301 __tmp.put_f32_le(self.integrated_zgyro);
23302 __tmp.put_u32_le(self.time_delta_distance_us);
23303 __tmp.put_f32_le(self.distance);
23304 __tmp.put_i16_le(self.temperature);
23305 __tmp.put_u8(self.sensor_id);
23306 __tmp.put_u8(self.quality);
23307 if matches!(version, MavlinkVersion::V2) {
23308 let len = __tmp.len();
23309 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23310 } else {
23311 __tmp.len()
23312 }
23313 }
23314}
23315#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
23316#[doc = ""]
23317#[doc = "ID: 360"]
23318#[derive(Debug, Clone, PartialEq)]
23319#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23320#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23321#[cfg_attr(feature = "ts", derive(TS))]
23322#[cfg_attr(feature = "ts", ts(export))]
23323pub struct ORBIT_EXECUTION_STATUS_DATA {
23324 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23325 pub time_usec: u64,
23326 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
23327 pub radius: f32,
23328 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23329 pub x: i32,
23330 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23331 pub y: i32,
23332 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
23333 pub z: f32,
23334 #[doc = "The coordinate system of the fields: x, y, z."]
23335 pub frame: MavFrame,
23336}
23337impl ORBIT_EXECUTION_STATUS_DATA {
23338 pub const ENCODED_LEN: usize = 25usize;
23339 pub const DEFAULT: Self = Self {
23340 time_usec: 0_u64,
23341 radius: 0.0_f32,
23342 x: 0_i32,
23343 y: 0_i32,
23344 z: 0.0_f32,
23345 frame: MavFrame::DEFAULT,
23346 };
23347 #[cfg(feature = "arbitrary")]
23348 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23349 use arbitrary::{Arbitrary, Unstructured};
23350 let mut buf = [0u8; 1024];
23351 rng.fill_bytes(&mut buf);
23352 let mut unstructured = Unstructured::new(&buf);
23353 Self::arbitrary(&mut unstructured).unwrap_or_default()
23354 }
23355}
23356impl Default for ORBIT_EXECUTION_STATUS_DATA {
23357 fn default() -> Self {
23358 Self::DEFAULT.clone()
23359 }
23360}
23361impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
23362 type Message = MavMessage;
23363 const ID: u32 = 360u32;
23364 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
23365 const EXTRA_CRC: u8 = 11u8;
23366 const ENCODED_LEN: usize = 25usize;
23367 fn deser(
23368 _version: MavlinkVersion,
23369 __input: &[u8],
23370 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23371 let avail_len = __input.len();
23372 let mut payload_buf = [0; Self::ENCODED_LEN];
23373 let mut buf = if avail_len < Self::ENCODED_LEN {
23374 payload_buf[0..avail_len].copy_from_slice(__input);
23375 Bytes::new(&payload_buf)
23376 } else {
23377 Bytes::new(__input)
23378 };
23379 let mut __struct = Self::default();
23380 __struct.time_usec = buf.get_u64_le();
23381 __struct.radius = buf.get_f32_le();
23382 __struct.x = buf.get_i32_le();
23383 __struct.y = buf.get_i32_le();
23384 __struct.z = buf.get_f32_le();
23385 let tmp = buf.get_u8();
23386 __struct.frame =
23387 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23388 enum_type: "MavFrame",
23389 value: tmp as u64,
23390 })?;
23391 Ok(__struct)
23392 }
23393 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23394 let mut __tmp = BytesMut::new(bytes);
23395 #[allow(clippy::absurd_extreme_comparisons)]
23396 #[allow(unused_comparisons)]
23397 if __tmp.remaining() < Self::ENCODED_LEN {
23398 panic!(
23399 "buffer is too small (need {} bytes, but got {})",
23400 Self::ENCODED_LEN,
23401 __tmp.remaining(),
23402 )
23403 }
23404 __tmp.put_u64_le(self.time_usec);
23405 __tmp.put_f32_le(self.radius);
23406 __tmp.put_i32_le(self.x);
23407 __tmp.put_i32_le(self.y);
23408 __tmp.put_f32_le(self.z);
23409 __tmp.put_u8(self.frame as u8);
23410 if matches!(version, MavlinkVersion::V2) {
23411 let len = __tmp.len();
23412 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23413 } else {
23414 __tmp.len()
23415 }
23416 }
23417}
23418#[doc = "Response from a PARAM_EXT_SET message."]
23419#[doc = ""]
23420#[doc = "ID: 324"]
23421#[derive(Debug, Clone, PartialEq)]
23422#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23423#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23424#[cfg_attr(feature = "ts", derive(TS))]
23425#[cfg_attr(feature = "ts", ts(export))]
23426pub struct PARAM_EXT_ACK_DATA {
23427 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23428 #[cfg_attr(feature = "ts", ts(type = "string"))]
23429 pub param_id: CharArray<16>,
23430 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
23431 #[cfg_attr(feature = "ts", ts(type = "string"))]
23432 pub param_value: CharArray<128>,
23433 #[doc = "Parameter type."]
23434 pub param_type: MavParamExtType,
23435 #[doc = "Result code."]
23436 pub param_result: ParamAck,
23437}
23438impl PARAM_EXT_ACK_DATA {
23439 pub const ENCODED_LEN: usize = 146usize;
23440 pub const DEFAULT: Self = Self {
23441 param_id: CharArray::new([0_u8; 16usize]),
23442 param_value: CharArray::new([0_u8; 128usize]),
23443 param_type: MavParamExtType::DEFAULT,
23444 param_result: ParamAck::DEFAULT,
23445 };
23446 #[cfg(feature = "arbitrary")]
23447 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23448 use arbitrary::{Arbitrary, Unstructured};
23449 let mut buf = [0u8; 1024];
23450 rng.fill_bytes(&mut buf);
23451 let mut unstructured = Unstructured::new(&buf);
23452 Self::arbitrary(&mut unstructured).unwrap_or_default()
23453 }
23454}
23455impl Default for PARAM_EXT_ACK_DATA {
23456 fn default() -> Self {
23457 Self::DEFAULT.clone()
23458 }
23459}
23460impl MessageData for PARAM_EXT_ACK_DATA {
23461 type Message = MavMessage;
23462 const ID: u32 = 324u32;
23463 const NAME: &'static str = "PARAM_EXT_ACK";
23464 const EXTRA_CRC: u8 = 132u8;
23465 const ENCODED_LEN: usize = 146usize;
23466 fn deser(
23467 _version: MavlinkVersion,
23468 __input: &[u8],
23469 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23470 let avail_len = __input.len();
23471 let mut payload_buf = [0; Self::ENCODED_LEN];
23472 let mut buf = if avail_len < Self::ENCODED_LEN {
23473 payload_buf[0..avail_len].copy_from_slice(__input);
23474 Bytes::new(&payload_buf)
23475 } else {
23476 Bytes::new(__input)
23477 };
23478 let mut __struct = Self::default();
23479 let mut tmp = [0_u8; 16usize];
23480 for v in &mut tmp {
23481 *v = buf.get_u8();
23482 }
23483 __struct.param_id = CharArray::new(tmp);
23484 let mut tmp = [0_u8; 128usize];
23485 for v in &mut tmp {
23486 *v = buf.get_u8();
23487 }
23488 __struct.param_value = CharArray::new(tmp);
23489 let tmp = buf.get_u8();
23490 __struct.param_type =
23491 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23492 enum_type: "MavParamExtType",
23493 value: tmp as u64,
23494 })?;
23495 let tmp = buf.get_u8();
23496 __struct.param_result =
23497 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23498 enum_type: "ParamAck",
23499 value: tmp as u64,
23500 })?;
23501 Ok(__struct)
23502 }
23503 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23504 let mut __tmp = BytesMut::new(bytes);
23505 #[allow(clippy::absurd_extreme_comparisons)]
23506 #[allow(unused_comparisons)]
23507 if __tmp.remaining() < Self::ENCODED_LEN {
23508 panic!(
23509 "buffer is too small (need {} bytes, but got {})",
23510 Self::ENCODED_LEN,
23511 __tmp.remaining(),
23512 )
23513 }
23514 for val in &self.param_id {
23515 __tmp.put_u8(*val);
23516 }
23517 for val in &self.param_value {
23518 __tmp.put_u8(*val);
23519 }
23520 __tmp.put_u8(self.param_type as u8);
23521 __tmp.put_u8(self.param_result as u8);
23522 if matches!(version, MavlinkVersion::V2) {
23523 let len = __tmp.len();
23524 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23525 } else {
23526 __tmp.len()
23527 }
23528 }
23529}
23530#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
23531#[doc = ""]
23532#[doc = "ID: 321"]
23533#[derive(Debug, Clone, PartialEq)]
23534#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23535#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23536#[cfg_attr(feature = "ts", derive(TS))]
23537#[cfg_attr(feature = "ts", ts(export))]
23538pub struct PARAM_EXT_REQUEST_LIST_DATA {
23539 #[doc = "System ID"]
23540 pub target_system: u8,
23541 #[doc = "Component ID"]
23542 pub target_component: u8,
23543}
23544impl PARAM_EXT_REQUEST_LIST_DATA {
23545 pub const ENCODED_LEN: usize = 2usize;
23546 pub const DEFAULT: Self = Self {
23547 target_system: 0_u8,
23548 target_component: 0_u8,
23549 };
23550 #[cfg(feature = "arbitrary")]
23551 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23552 use arbitrary::{Arbitrary, Unstructured};
23553 let mut buf = [0u8; 1024];
23554 rng.fill_bytes(&mut buf);
23555 let mut unstructured = Unstructured::new(&buf);
23556 Self::arbitrary(&mut unstructured).unwrap_or_default()
23557 }
23558}
23559impl Default for PARAM_EXT_REQUEST_LIST_DATA {
23560 fn default() -> Self {
23561 Self::DEFAULT.clone()
23562 }
23563}
23564impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
23565 type Message = MavMessage;
23566 const ID: u32 = 321u32;
23567 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
23568 const EXTRA_CRC: u8 = 88u8;
23569 const ENCODED_LEN: usize = 2usize;
23570 fn deser(
23571 _version: MavlinkVersion,
23572 __input: &[u8],
23573 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23574 let avail_len = __input.len();
23575 let mut payload_buf = [0; Self::ENCODED_LEN];
23576 let mut buf = if avail_len < Self::ENCODED_LEN {
23577 payload_buf[0..avail_len].copy_from_slice(__input);
23578 Bytes::new(&payload_buf)
23579 } else {
23580 Bytes::new(__input)
23581 };
23582 let mut __struct = Self::default();
23583 __struct.target_system = buf.get_u8();
23584 __struct.target_component = buf.get_u8();
23585 Ok(__struct)
23586 }
23587 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23588 let mut __tmp = BytesMut::new(bytes);
23589 #[allow(clippy::absurd_extreme_comparisons)]
23590 #[allow(unused_comparisons)]
23591 if __tmp.remaining() < Self::ENCODED_LEN {
23592 panic!(
23593 "buffer is too small (need {} bytes, but got {})",
23594 Self::ENCODED_LEN,
23595 __tmp.remaining(),
23596 )
23597 }
23598 __tmp.put_u8(self.target_system);
23599 __tmp.put_u8(self.target_component);
23600 if matches!(version, MavlinkVersion::V2) {
23601 let len = __tmp.len();
23602 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23603 } else {
23604 __tmp.len()
23605 }
23606 }
23607}
23608#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
23609#[doc = ""]
23610#[doc = "ID: 320"]
23611#[derive(Debug, Clone, PartialEq)]
23612#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23613#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23614#[cfg_attr(feature = "ts", derive(TS))]
23615#[cfg_attr(feature = "ts", ts(export))]
23616pub struct PARAM_EXT_REQUEST_READ_DATA {
23617 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
23618 pub param_index: i16,
23619 #[doc = "System ID"]
23620 pub target_system: u8,
23621 #[doc = "Component ID"]
23622 pub target_component: u8,
23623 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23624 #[cfg_attr(feature = "ts", ts(type = "string"))]
23625 pub param_id: CharArray<16>,
23626}
23627impl PARAM_EXT_REQUEST_READ_DATA {
23628 pub const ENCODED_LEN: usize = 20usize;
23629 pub const DEFAULT: Self = Self {
23630 param_index: 0_i16,
23631 target_system: 0_u8,
23632 target_component: 0_u8,
23633 param_id: CharArray::new([0_u8; 16usize]),
23634 };
23635 #[cfg(feature = "arbitrary")]
23636 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23637 use arbitrary::{Arbitrary, Unstructured};
23638 let mut buf = [0u8; 1024];
23639 rng.fill_bytes(&mut buf);
23640 let mut unstructured = Unstructured::new(&buf);
23641 Self::arbitrary(&mut unstructured).unwrap_or_default()
23642 }
23643}
23644impl Default for PARAM_EXT_REQUEST_READ_DATA {
23645 fn default() -> Self {
23646 Self::DEFAULT.clone()
23647 }
23648}
23649impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
23650 type Message = MavMessage;
23651 const ID: u32 = 320u32;
23652 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
23653 const EXTRA_CRC: u8 = 243u8;
23654 const ENCODED_LEN: usize = 20usize;
23655 fn deser(
23656 _version: MavlinkVersion,
23657 __input: &[u8],
23658 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23659 let avail_len = __input.len();
23660 let mut payload_buf = [0; Self::ENCODED_LEN];
23661 let mut buf = if avail_len < Self::ENCODED_LEN {
23662 payload_buf[0..avail_len].copy_from_slice(__input);
23663 Bytes::new(&payload_buf)
23664 } else {
23665 Bytes::new(__input)
23666 };
23667 let mut __struct = Self::default();
23668 __struct.param_index = buf.get_i16_le();
23669 __struct.target_system = buf.get_u8();
23670 __struct.target_component = buf.get_u8();
23671 let mut tmp = [0_u8; 16usize];
23672 for v in &mut tmp {
23673 *v = buf.get_u8();
23674 }
23675 __struct.param_id = CharArray::new(tmp);
23676 Ok(__struct)
23677 }
23678 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23679 let mut __tmp = BytesMut::new(bytes);
23680 #[allow(clippy::absurd_extreme_comparisons)]
23681 #[allow(unused_comparisons)]
23682 if __tmp.remaining() < Self::ENCODED_LEN {
23683 panic!(
23684 "buffer is too small (need {} bytes, but got {})",
23685 Self::ENCODED_LEN,
23686 __tmp.remaining(),
23687 )
23688 }
23689 __tmp.put_i16_le(self.param_index);
23690 __tmp.put_u8(self.target_system);
23691 __tmp.put_u8(self.target_component);
23692 for val in &self.param_id {
23693 __tmp.put_u8(*val);
23694 }
23695 if matches!(version, MavlinkVersion::V2) {
23696 let len = __tmp.len();
23697 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23698 } else {
23699 __tmp.len()
23700 }
23701 }
23702}
23703#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
23704#[doc = ""]
23705#[doc = "ID: 323"]
23706#[derive(Debug, Clone, PartialEq)]
23707#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23708#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23709#[cfg_attr(feature = "ts", derive(TS))]
23710#[cfg_attr(feature = "ts", ts(export))]
23711pub struct PARAM_EXT_SET_DATA {
23712 #[doc = "System ID"]
23713 pub target_system: u8,
23714 #[doc = "Component ID"]
23715 pub target_component: u8,
23716 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23717 #[cfg_attr(feature = "ts", ts(type = "string"))]
23718 pub param_id: CharArray<16>,
23719 #[doc = "Parameter value"]
23720 #[cfg_attr(feature = "ts", ts(type = "string"))]
23721 pub param_value: CharArray<128>,
23722 #[doc = "Parameter type."]
23723 pub param_type: MavParamExtType,
23724}
23725impl PARAM_EXT_SET_DATA {
23726 pub const ENCODED_LEN: usize = 147usize;
23727 pub const DEFAULT: Self = Self {
23728 target_system: 0_u8,
23729 target_component: 0_u8,
23730 param_id: CharArray::new([0_u8; 16usize]),
23731 param_value: CharArray::new([0_u8; 128usize]),
23732 param_type: MavParamExtType::DEFAULT,
23733 };
23734 #[cfg(feature = "arbitrary")]
23735 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23736 use arbitrary::{Arbitrary, Unstructured};
23737 let mut buf = [0u8; 1024];
23738 rng.fill_bytes(&mut buf);
23739 let mut unstructured = Unstructured::new(&buf);
23740 Self::arbitrary(&mut unstructured).unwrap_or_default()
23741 }
23742}
23743impl Default for PARAM_EXT_SET_DATA {
23744 fn default() -> Self {
23745 Self::DEFAULT.clone()
23746 }
23747}
23748impl MessageData for PARAM_EXT_SET_DATA {
23749 type Message = MavMessage;
23750 const ID: u32 = 323u32;
23751 const NAME: &'static str = "PARAM_EXT_SET";
23752 const EXTRA_CRC: u8 = 78u8;
23753 const ENCODED_LEN: usize = 147usize;
23754 fn deser(
23755 _version: MavlinkVersion,
23756 __input: &[u8],
23757 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23758 let avail_len = __input.len();
23759 let mut payload_buf = [0; Self::ENCODED_LEN];
23760 let mut buf = if avail_len < Self::ENCODED_LEN {
23761 payload_buf[0..avail_len].copy_from_slice(__input);
23762 Bytes::new(&payload_buf)
23763 } else {
23764 Bytes::new(__input)
23765 };
23766 let mut __struct = Self::default();
23767 __struct.target_system = buf.get_u8();
23768 __struct.target_component = buf.get_u8();
23769 let mut tmp = [0_u8; 16usize];
23770 for v in &mut tmp {
23771 *v = buf.get_u8();
23772 }
23773 __struct.param_id = CharArray::new(tmp);
23774 let mut tmp = [0_u8; 128usize];
23775 for v in &mut tmp {
23776 *v = buf.get_u8();
23777 }
23778 __struct.param_value = CharArray::new(tmp);
23779 let tmp = buf.get_u8();
23780 __struct.param_type =
23781 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23782 enum_type: "MavParamExtType",
23783 value: tmp as u64,
23784 })?;
23785 Ok(__struct)
23786 }
23787 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23788 let mut __tmp = BytesMut::new(bytes);
23789 #[allow(clippy::absurd_extreme_comparisons)]
23790 #[allow(unused_comparisons)]
23791 if __tmp.remaining() < Self::ENCODED_LEN {
23792 panic!(
23793 "buffer is too small (need {} bytes, but got {})",
23794 Self::ENCODED_LEN,
23795 __tmp.remaining(),
23796 )
23797 }
23798 __tmp.put_u8(self.target_system);
23799 __tmp.put_u8(self.target_component);
23800 for val in &self.param_id {
23801 __tmp.put_u8(*val);
23802 }
23803 for val in &self.param_value {
23804 __tmp.put_u8(*val);
23805 }
23806 __tmp.put_u8(self.param_type as u8);
23807 if matches!(version, MavlinkVersion::V2) {
23808 let len = __tmp.len();
23809 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23810 } else {
23811 __tmp.len()
23812 }
23813 }
23814}
23815#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
23816#[doc = ""]
23817#[doc = "ID: 322"]
23818#[derive(Debug, Clone, PartialEq)]
23819#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23821#[cfg_attr(feature = "ts", derive(TS))]
23822#[cfg_attr(feature = "ts", ts(export))]
23823pub struct PARAM_EXT_VALUE_DATA {
23824 #[doc = "Total number of parameters"]
23825 pub param_count: u16,
23826 #[doc = "Index of this parameter"]
23827 pub param_index: u16,
23828 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23829 #[cfg_attr(feature = "ts", ts(type = "string"))]
23830 pub param_id: CharArray<16>,
23831 #[doc = "Parameter value"]
23832 #[cfg_attr(feature = "ts", ts(type = "string"))]
23833 pub param_value: CharArray<128>,
23834 #[doc = "Parameter type."]
23835 pub param_type: MavParamExtType,
23836}
23837impl PARAM_EXT_VALUE_DATA {
23838 pub const ENCODED_LEN: usize = 149usize;
23839 pub const DEFAULT: Self = Self {
23840 param_count: 0_u16,
23841 param_index: 0_u16,
23842 param_id: CharArray::new([0_u8; 16usize]),
23843 param_value: CharArray::new([0_u8; 128usize]),
23844 param_type: MavParamExtType::DEFAULT,
23845 };
23846 #[cfg(feature = "arbitrary")]
23847 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23848 use arbitrary::{Arbitrary, Unstructured};
23849 let mut buf = [0u8; 1024];
23850 rng.fill_bytes(&mut buf);
23851 let mut unstructured = Unstructured::new(&buf);
23852 Self::arbitrary(&mut unstructured).unwrap_or_default()
23853 }
23854}
23855impl Default for PARAM_EXT_VALUE_DATA {
23856 fn default() -> Self {
23857 Self::DEFAULT.clone()
23858 }
23859}
23860impl MessageData for PARAM_EXT_VALUE_DATA {
23861 type Message = MavMessage;
23862 const ID: u32 = 322u32;
23863 const NAME: &'static str = "PARAM_EXT_VALUE";
23864 const EXTRA_CRC: u8 = 243u8;
23865 const ENCODED_LEN: usize = 149usize;
23866 fn deser(
23867 _version: MavlinkVersion,
23868 __input: &[u8],
23869 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23870 let avail_len = __input.len();
23871 let mut payload_buf = [0; Self::ENCODED_LEN];
23872 let mut buf = if avail_len < Self::ENCODED_LEN {
23873 payload_buf[0..avail_len].copy_from_slice(__input);
23874 Bytes::new(&payload_buf)
23875 } else {
23876 Bytes::new(__input)
23877 };
23878 let mut __struct = Self::default();
23879 __struct.param_count = buf.get_u16_le();
23880 __struct.param_index = buf.get_u16_le();
23881 let mut tmp = [0_u8; 16usize];
23882 for v in &mut tmp {
23883 *v = buf.get_u8();
23884 }
23885 __struct.param_id = CharArray::new(tmp);
23886 let mut tmp = [0_u8; 128usize];
23887 for v in &mut tmp {
23888 *v = buf.get_u8();
23889 }
23890 __struct.param_value = CharArray::new(tmp);
23891 let tmp = buf.get_u8();
23892 __struct.param_type =
23893 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23894 enum_type: "MavParamExtType",
23895 value: tmp as u64,
23896 })?;
23897 Ok(__struct)
23898 }
23899 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23900 let mut __tmp = BytesMut::new(bytes);
23901 #[allow(clippy::absurd_extreme_comparisons)]
23902 #[allow(unused_comparisons)]
23903 if __tmp.remaining() < Self::ENCODED_LEN {
23904 panic!(
23905 "buffer is too small (need {} bytes, but got {})",
23906 Self::ENCODED_LEN,
23907 __tmp.remaining(),
23908 )
23909 }
23910 __tmp.put_u16_le(self.param_count);
23911 __tmp.put_u16_le(self.param_index);
23912 for val in &self.param_id {
23913 __tmp.put_u8(*val);
23914 }
23915 for val in &self.param_value {
23916 __tmp.put_u8(*val);
23917 }
23918 __tmp.put_u8(self.param_type as u8);
23919 if matches!(version, MavlinkVersion::V2) {
23920 let len = __tmp.len();
23921 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23922 } else {
23923 __tmp.len()
23924 }
23925 }
23926}
23927#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
23928#[doc = ""]
23929#[doc = "ID: 50"]
23930#[derive(Debug, Clone, PartialEq)]
23931#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23932#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23933#[cfg_attr(feature = "ts", derive(TS))]
23934#[cfg_attr(feature = "ts", ts(export))]
23935pub struct PARAM_MAP_RC_DATA {
23936 #[doc = "Initial parameter value"]
23937 pub param_value0: f32,
23938 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
23939 pub scale: f32,
23940 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
23941 pub param_value_min: f32,
23942 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
23943 pub param_value_max: f32,
23944 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
23945 pub param_index: i16,
23946 #[doc = "System ID"]
23947 pub target_system: u8,
23948 #[doc = "Component ID"]
23949 pub target_component: u8,
23950 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23951 #[cfg_attr(feature = "ts", ts(type = "string"))]
23952 pub param_id: CharArray<16>,
23953 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
23954 pub parameter_rc_channel_index: u8,
23955}
23956impl PARAM_MAP_RC_DATA {
23957 pub const ENCODED_LEN: usize = 37usize;
23958 pub const DEFAULT: Self = Self {
23959 param_value0: 0.0_f32,
23960 scale: 0.0_f32,
23961 param_value_min: 0.0_f32,
23962 param_value_max: 0.0_f32,
23963 param_index: 0_i16,
23964 target_system: 0_u8,
23965 target_component: 0_u8,
23966 param_id: CharArray::new([0_u8; 16usize]),
23967 parameter_rc_channel_index: 0_u8,
23968 };
23969 #[cfg(feature = "arbitrary")]
23970 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23971 use arbitrary::{Arbitrary, Unstructured};
23972 let mut buf = [0u8; 1024];
23973 rng.fill_bytes(&mut buf);
23974 let mut unstructured = Unstructured::new(&buf);
23975 Self::arbitrary(&mut unstructured).unwrap_or_default()
23976 }
23977}
23978impl Default for PARAM_MAP_RC_DATA {
23979 fn default() -> Self {
23980 Self::DEFAULT.clone()
23981 }
23982}
23983impl MessageData for PARAM_MAP_RC_DATA {
23984 type Message = MavMessage;
23985 const ID: u32 = 50u32;
23986 const NAME: &'static str = "PARAM_MAP_RC";
23987 const EXTRA_CRC: u8 = 78u8;
23988 const ENCODED_LEN: usize = 37usize;
23989 fn deser(
23990 _version: MavlinkVersion,
23991 __input: &[u8],
23992 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23993 let avail_len = __input.len();
23994 let mut payload_buf = [0; Self::ENCODED_LEN];
23995 let mut buf = if avail_len < Self::ENCODED_LEN {
23996 payload_buf[0..avail_len].copy_from_slice(__input);
23997 Bytes::new(&payload_buf)
23998 } else {
23999 Bytes::new(__input)
24000 };
24001 let mut __struct = Self::default();
24002 __struct.param_value0 = buf.get_f32_le();
24003 __struct.scale = buf.get_f32_le();
24004 __struct.param_value_min = buf.get_f32_le();
24005 __struct.param_value_max = buf.get_f32_le();
24006 __struct.param_index = buf.get_i16_le();
24007 __struct.target_system = buf.get_u8();
24008 __struct.target_component = buf.get_u8();
24009 let mut tmp = [0_u8; 16usize];
24010 for v in &mut tmp {
24011 *v = buf.get_u8();
24012 }
24013 __struct.param_id = CharArray::new(tmp);
24014 __struct.parameter_rc_channel_index = buf.get_u8();
24015 Ok(__struct)
24016 }
24017 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24018 let mut __tmp = BytesMut::new(bytes);
24019 #[allow(clippy::absurd_extreme_comparisons)]
24020 #[allow(unused_comparisons)]
24021 if __tmp.remaining() < Self::ENCODED_LEN {
24022 panic!(
24023 "buffer is too small (need {} bytes, but got {})",
24024 Self::ENCODED_LEN,
24025 __tmp.remaining(),
24026 )
24027 }
24028 __tmp.put_f32_le(self.param_value0);
24029 __tmp.put_f32_le(self.scale);
24030 __tmp.put_f32_le(self.param_value_min);
24031 __tmp.put_f32_le(self.param_value_max);
24032 __tmp.put_i16_le(self.param_index);
24033 __tmp.put_u8(self.target_system);
24034 __tmp.put_u8(self.target_component);
24035 for val in &self.param_id {
24036 __tmp.put_u8(*val);
24037 }
24038 __tmp.put_u8(self.parameter_rc_channel_index);
24039 if matches!(version, MavlinkVersion::V2) {
24040 let len = __tmp.len();
24041 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24042 } else {
24043 __tmp.len()
24044 }
24045 }
24046}
24047#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24048#[doc = ""]
24049#[doc = "ID: 21"]
24050#[derive(Debug, Clone, PartialEq)]
24051#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24052#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24053#[cfg_attr(feature = "ts", derive(TS))]
24054#[cfg_attr(feature = "ts", ts(export))]
24055pub struct PARAM_REQUEST_LIST_DATA {
24056 #[doc = "System ID"]
24057 pub target_system: u8,
24058 #[doc = "Component ID"]
24059 pub target_component: u8,
24060}
24061impl PARAM_REQUEST_LIST_DATA {
24062 pub const ENCODED_LEN: usize = 2usize;
24063 pub const DEFAULT: Self = Self {
24064 target_system: 0_u8,
24065 target_component: 0_u8,
24066 };
24067 #[cfg(feature = "arbitrary")]
24068 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24069 use arbitrary::{Arbitrary, Unstructured};
24070 let mut buf = [0u8; 1024];
24071 rng.fill_bytes(&mut buf);
24072 let mut unstructured = Unstructured::new(&buf);
24073 Self::arbitrary(&mut unstructured).unwrap_or_default()
24074 }
24075}
24076impl Default for PARAM_REQUEST_LIST_DATA {
24077 fn default() -> Self {
24078 Self::DEFAULT.clone()
24079 }
24080}
24081impl MessageData for PARAM_REQUEST_LIST_DATA {
24082 type Message = MavMessage;
24083 const ID: u32 = 21u32;
24084 const NAME: &'static str = "PARAM_REQUEST_LIST";
24085 const EXTRA_CRC: u8 = 159u8;
24086 const ENCODED_LEN: usize = 2usize;
24087 fn deser(
24088 _version: MavlinkVersion,
24089 __input: &[u8],
24090 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24091 let avail_len = __input.len();
24092 let mut payload_buf = [0; Self::ENCODED_LEN];
24093 let mut buf = if avail_len < Self::ENCODED_LEN {
24094 payload_buf[0..avail_len].copy_from_slice(__input);
24095 Bytes::new(&payload_buf)
24096 } else {
24097 Bytes::new(__input)
24098 };
24099 let mut __struct = Self::default();
24100 __struct.target_system = buf.get_u8();
24101 __struct.target_component = buf.get_u8();
24102 Ok(__struct)
24103 }
24104 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24105 let mut __tmp = BytesMut::new(bytes);
24106 #[allow(clippy::absurd_extreme_comparisons)]
24107 #[allow(unused_comparisons)]
24108 if __tmp.remaining() < Self::ENCODED_LEN {
24109 panic!(
24110 "buffer is too small (need {} bytes, but got {})",
24111 Self::ENCODED_LEN,
24112 __tmp.remaining(),
24113 )
24114 }
24115 __tmp.put_u8(self.target_system);
24116 __tmp.put_u8(self.target_component);
24117 if matches!(version, MavlinkVersion::V2) {
24118 let len = __tmp.len();
24119 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24120 } else {
24121 __tmp.len()
24122 }
24123 }
24124}
24125#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
24126#[doc = ""]
24127#[doc = "ID: 20"]
24128#[derive(Debug, Clone, PartialEq)]
24129#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24131#[cfg_attr(feature = "ts", derive(TS))]
24132#[cfg_attr(feature = "ts", ts(export))]
24133pub struct PARAM_REQUEST_READ_DATA {
24134 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
24135 pub param_index: i16,
24136 #[doc = "System ID"]
24137 pub target_system: u8,
24138 #[doc = "Component ID"]
24139 pub target_component: u8,
24140 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24141 #[cfg_attr(feature = "ts", ts(type = "string"))]
24142 pub param_id: CharArray<16>,
24143}
24144impl PARAM_REQUEST_READ_DATA {
24145 pub const ENCODED_LEN: usize = 20usize;
24146 pub const DEFAULT: Self = Self {
24147 param_index: 0_i16,
24148 target_system: 0_u8,
24149 target_component: 0_u8,
24150 param_id: CharArray::new([0_u8; 16usize]),
24151 };
24152 #[cfg(feature = "arbitrary")]
24153 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24154 use arbitrary::{Arbitrary, Unstructured};
24155 let mut buf = [0u8; 1024];
24156 rng.fill_bytes(&mut buf);
24157 let mut unstructured = Unstructured::new(&buf);
24158 Self::arbitrary(&mut unstructured).unwrap_or_default()
24159 }
24160}
24161impl Default for PARAM_REQUEST_READ_DATA {
24162 fn default() -> Self {
24163 Self::DEFAULT.clone()
24164 }
24165}
24166impl MessageData for PARAM_REQUEST_READ_DATA {
24167 type Message = MavMessage;
24168 const ID: u32 = 20u32;
24169 const NAME: &'static str = "PARAM_REQUEST_READ";
24170 const EXTRA_CRC: u8 = 214u8;
24171 const ENCODED_LEN: usize = 20usize;
24172 fn deser(
24173 _version: MavlinkVersion,
24174 __input: &[u8],
24175 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24176 let avail_len = __input.len();
24177 let mut payload_buf = [0; Self::ENCODED_LEN];
24178 let mut buf = if avail_len < Self::ENCODED_LEN {
24179 payload_buf[0..avail_len].copy_from_slice(__input);
24180 Bytes::new(&payload_buf)
24181 } else {
24182 Bytes::new(__input)
24183 };
24184 let mut __struct = Self::default();
24185 __struct.param_index = buf.get_i16_le();
24186 __struct.target_system = buf.get_u8();
24187 __struct.target_component = buf.get_u8();
24188 let mut tmp = [0_u8; 16usize];
24189 for v in &mut tmp {
24190 *v = buf.get_u8();
24191 }
24192 __struct.param_id = CharArray::new(tmp);
24193 Ok(__struct)
24194 }
24195 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24196 let mut __tmp = BytesMut::new(bytes);
24197 #[allow(clippy::absurd_extreme_comparisons)]
24198 #[allow(unused_comparisons)]
24199 if __tmp.remaining() < Self::ENCODED_LEN {
24200 panic!(
24201 "buffer is too small (need {} bytes, but got {})",
24202 Self::ENCODED_LEN,
24203 __tmp.remaining(),
24204 )
24205 }
24206 __tmp.put_i16_le(self.param_index);
24207 __tmp.put_u8(self.target_system);
24208 __tmp.put_u8(self.target_component);
24209 for val in &self.param_id {
24210 __tmp.put_u8(*val);
24211 }
24212 if matches!(version, MavlinkVersion::V2) {
24213 let len = __tmp.len();
24214 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24215 } else {
24216 __tmp.len()
24217 }
24218 }
24219}
24220#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24221#[doc = ""]
24222#[doc = "ID: 23"]
24223#[derive(Debug, Clone, PartialEq)]
24224#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24225#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24226#[cfg_attr(feature = "ts", derive(TS))]
24227#[cfg_attr(feature = "ts", ts(export))]
24228pub struct PARAM_SET_DATA {
24229 #[doc = "Onboard parameter value"]
24230 pub param_value: f32,
24231 #[doc = "System ID"]
24232 pub target_system: u8,
24233 #[doc = "Component ID"]
24234 pub target_component: u8,
24235 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24236 #[cfg_attr(feature = "ts", ts(type = "string"))]
24237 pub param_id: CharArray<16>,
24238 #[doc = "Onboard parameter type."]
24239 pub param_type: MavParamType,
24240}
24241impl PARAM_SET_DATA {
24242 pub const ENCODED_LEN: usize = 23usize;
24243 pub const DEFAULT: Self = Self {
24244 param_value: 0.0_f32,
24245 target_system: 0_u8,
24246 target_component: 0_u8,
24247 param_id: CharArray::new([0_u8; 16usize]),
24248 param_type: MavParamType::DEFAULT,
24249 };
24250 #[cfg(feature = "arbitrary")]
24251 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24252 use arbitrary::{Arbitrary, Unstructured};
24253 let mut buf = [0u8; 1024];
24254 rng.fill_bytes(&mut buf);
24255 let mut unstructured = Unstructured::new(&buf);
24256 Self::arbitrary(&mut unstructured).unwrap_or_default()
24257 }
24258}
24259impl Default for PARAM_SET_DATA {
24260 fn default() -> Self {
24261 Self::DEFAULT.clone()
24262 }
24263}
24264impl MessageData for PARAM_SET_DATA {
24265 type Message = MavMessage;
24266 const ID: u32 = 23u32;
24267 const NAME: &'static str = "PARAM_SET";
24268 const EXTRA_CRC: u8 = 168u8;
24269 const ENCODED_LEN: usize = 23usize;
24270 fn deser(
24271 _version: MavlinkVersion,
24272 __input: &[u8],
24273 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24274 let avail_len = __input.len();
24275 let mut payload_buf = [0; Self::ENCODED_LEN];
24276 let mut buf = if avail_len < Self::ENCODED_LEN {
24277 payload_buf[0..avail_len].copy_from_slice(__input);
24278 Bytes::new(&payload_buf)
24279 } else {
24280 Bytes::new(__input)
24281 };
24282 let mut __struct = Self::default();
24283 __struct.param_value = buf.get_f32_le();
24284 __struct.target_system = buf.get_u8();
24285 __struct.target_component = buf.get_u8();
24286 let mut tmp = [0_u8; 16usize];
24287 for v in &mut tmp {
24288 *v = buf.get_u8();
24289 }
24290 __struct.param_id = CharArray::new(tmp);
24291 let tmp = buf.get_u8();
24292 __struct.param_type =
24293 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24294 enum_type: "MavParamType",
24295 value: tmp as u64,
24296 })?;
24297 Ok(__struct)
24298 }
24299 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24300 let mut __tmp = BytesMut::new(bytes);
24301 #[allow(clippy::absurd_extreme_comparisons)]
24302 #[allow(unused_comparisons)]
24303 if __tmp.remaining() < Self::ENCODED_LEN {
24304 panic!(
24305 "buffer is too small (need {} bytes, but got {})",
24306 Self::ENCODED_LEN,
24307 __tmp.remaining(),
24308 )
24309 }
24310 __tmp.put_f32_le(self.param_value);
24311 __tmp.put_u8(self.target_system);
24312 __tmp.put_u8(self.target_component);
24313 for val in &self.param_id {
24314 __tmp.put_u8(*val);
24315 }
24316 __tmp.put_u8(self.param_type as u8);
24317 if matches!(version, MavlinkVersion::V2) {
24318 let len = __tmp.len();
24319 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24320 } else {
24321 __tmp.len()
24322 }
24323 }
24324}
24325#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24326#[doc = ""]
24327#[doc = "ID: 22"]
24328#[derive(Debug, Clone, PartialEq)]
24329#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24330#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24331#[cfg_attr(feature = "ts", derive(TS))]
24332#[cfg_attr(feature = "ts", ts(export))]
24333pub struct PARAM_VALUE_DATA {
24334 #[doc = "Onboard parameter value"]
24335 pub param_value: f32,
24336 #[doc = "Total number of onboard parameters"]
24337 pub param_count: u16,
24338 #[doc = "Index of this onboard parameter"]
24339 pub param_index: u16,
24340 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24341 #[cfg_attr(feature = "ts", ts(type = "string"))]
24342 pub param_id: CharArray<16>,
24343 #[doc = "Onboard parameter type."]
24344 pub param_type: MavParamType,
24345}
24346impl PARAM_VALUE_DATA {
24347 pub const ENCODED_LEN: usize = 25usize;
24348 pub const DEFAULT: Self = Self {
24349 param_value: 0.0_f32,
24350 param_count: 0_u16,
24351 param_index: 0_u16,
24352 param_id: CharArray::new([0_u8; 16usize]),
24353 param_type: MavParamType::DEFAULT,
24354 };
24355 #[cfg(feature = "arbitrary")]
24356 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24357 use arbitrary::{Arbitrary, Unstructured};
24358 let mut buf = [0u8; 1024];
24359 rng.fill_bytes(&mut buf);
24360 let mut unstructured = Unstructured::new(&buf);
24361 Self::arbitrary(&mut unstructured).unwrap_or_default()
24362 }
24363}
24364impl Default for PARAM_VALUE_DATA {
24365 fn default() -> Self {
24366 Self::DEFAULT.clone()
24367 }
24368}
24369impl MessageData for PARAM_VALUE_DATA {
24370 type Message = MavMessage;
24371 const ID: u32 = 22u32;
24372 const NAME: &'static str = "PARAM_VALUE";
24373 const EXTRA_CRC: u8 = 220u8;
24374 const ENCODED_LEN: usize = 25usize;
24375 fn deser(
24376 _version: MavlinkVersion,
24377 __input: &[u8],
24378 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24379 let avail_len = __input.len();
24380 let mut payload_buf = [0; Self::ENCODED_LEN];
24381 let mut buf = if avail_len < Self::ENCODED_LEN {
24382 payload_buf[0..avail_len].copy_from_slice(__input);
24383 Bytes::new(&payload_buf)
24384 } else {
24385 Bytes::new(__input)
24386 };
24387 let mut __struct = Self::default();
24388 __struct.param_value = buf.get_f32_le();
24389 __struct.param_count = buf.get_u16_le();
24390 __struct.param_index = buf.get_u16_le();
24391 let mut tmp = [0_u8; 16usize];
24392 for v in &mut tmp {
24393 *v = buf.get_u8();
24394 }
24395 __struct.param_id = CharArray::new(tmp);
24396 let tmp = buf.get_u8();
24397 __struct.param_type =
24398 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24399 enum_type: "MavParamType",
24400 value: tmp as u64,
24401 })?;
24402 Ok(__struct)
24403 }
24404 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24405 let mut __tmp = BytesMut::new(bytes);
24406 #[allow(clippy::absurd_extreme_comparisons)]
24407 #[allow(unused_comparisons)]
24408 if __tmp.remaining() < Self::ENCODED_LEN {
24409 panic!(
24410 "buffer is too small (need {} bytes, but got {})",
24411 Self::ENCODED_LEN,
24412 __tmp.remaining(),
24413 )
24414 }
24415 __tmp.put_f32_le(self.param_value);
24416 __tmp.put_u16_le(self.param_count);
24417 __tmp.put_u16_le(self.param_index);
24418 for val in &self.param_id {
24419 __tmp.put_u8(*val);
24420 }
24421 __tmp.put_u8(self.param_type as u8);
24422 if matches!(version, MavlinkVersion::V2) {
24423 let len = __tmp.len();
24424 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24425 } else {
24426 __tmp.len()
24427 }
24428 }
24429}
24430#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
24431#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
24432#[doc = ""]
24433#[doc = "ID: 4"]
24434#[derive(Debug, Clone, PartialEq)]
24435#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24436#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24437#[cfg_attr(feature = "ts", derive(TS))]
24438#[cfg_attr(feature = "ts", ts(export))]
24439pub struct PING_DATA {
24440 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24441 pub time_usec: u64,
24442 #[doc = "PING sequence"]
24443 pub seq: u32,
24444 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
24445 pub target_system: u8,
24446 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
24447 pub target_component: u8,
24448}
24449impl PING_DATA {
24450 pub const ENCODED_LEN: usize = 14usize;
24451 pub const DEFAULT: Self = Self {
24452 time_usec: 0_u64,
24453 seq: 0_u32,
24454 target_system: 0_u8,
24455 target_component: 0_u8,
24456 };
24457 #[cfg(feature = "arbitrary")]
24458 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24459 use arbitrary::{Arbitrary, Unstructured};
24460 let mut buf = [0u8; 1024];
24461 rng.fill_bytes(&mut buf);
24462 let mut unstructured = Unstructured::new(&buf);
24463 Self::arbitrary(&mut unstructured).unwrap_or_default()
24464 }
24465}
24466impl Default for PING_DATA {
24467 fn default() -> Self {
24468 Self::DEFAULT.clone()
24469 }
24470}
24471impl MessageData for PING_DATA {
24472 type Message = MavMessage;
24473 const ID: u32 = 4u32;
24474 const NAME: &'static str = "PING";
24475 const EXTRA_CRC: u8 = 237u8;
24476 const ENCODED_LEN: usize = 14usize;
24477 fn deser(
24478 _version: MavlinkVersion,
24479 __input: &[u8],
24480 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24481 let avail_len = __input.len();
24482 let mut payload_buf = [0; Self::ENCODED_LEN];
24483 let mut buf = if avail_len < Self::ENCODED_LEN {
24484 payload_buf[0..avail_len].copy_from_slice(__input);
24485 Bytes::new(&payload_buf)
24486 } else {
24487 Bytes::new(__input)
24488 };
24489 let mut __struct = Self::default();
24490 __struct.time_usec = buf.get_u64_le();
24491 __struct.seq = buf.get_u32_le();
24492 __struct.target_system = buf.get_u8();
24493 __struct.target_component = buf.get_u8();
24494 Ok(__struct)
24495 }
24496 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24497 let mut __tmp = BytesMut::new(bytes);
24498 #[allow(clippy::absurd_extreme_comparisons)]
24499 #[allow(unused_comparisons)]
24500 if __tmp.remaining() < Self::ENCODED_LEN {
24501 panic!(
24502 "buffer is too small (need {} bytes, but got {})",
24503 Self::ENCODED_LEN,
24504 __tmp.remaining(),
24505 )
24506 }
24507 __tmp.put_u64_le(self.time_usec);
24508 __tmp.put_u32_le(self.seq);
24509 __tmp.put_u8(self.target_system);
24510 __tmp.put_u8(self.target_component);
24511 if matches!(version, MavlinkVersion::V2) {
24512 let len = __tmp.len();
24513 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24514 } else {
24515 __tmp.len()
24516 }
24517 }
24518}
24519#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
24520#[doc = "Control vehicle tone generation (buzzer)."]
24521#[doc = ""]
24522#[doc = "ID: 258"]
24523#[derive(Debug, Clone, PartialEq)]
24524#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24525#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24526#[cfg_attr(feature = "ts", derive(TS))]
24527#[cfg_attr(feature = "ts", ts(export))]
24528pub struct PLAY_TUNE_DATA {
24529 #[doc = "System ID"]
24530 pub target_system: u8,
24531 #[doc = "Component ID"]
24532 pub target_component: u8,
24533 #[doc = "tune in board specific format"]
24534 #[cfg_attr(feature = "ts", ts(type = "string"))]
24535 pub tune: CharArray<30>,
24536 #[doc = "tune extension (appended to tune)"]
24537 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24538 #[cfg_attr(feature = "ts", ts(type = "string"))]
24539 pub tune2: CharArray<200>,
24540}
24541impl PLAY_TUNE_DATA {
24542 pub const ENCODED_LEN: usize = 232usize;
24543 pub const DEFAULT: Self = Self {
24544 target_system: 0_u8,
24545 target_component: 0_u8,
24546 tune: CharArray::new([0_u8; 30usize]),
24547 tune2: CharArray::new([0_u8; 200usize]),
24548 };
24549 #[cfg(feature = "arbitrary")]
24550 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24551 use arbitrary::{Arbitrary, Unstructured};
24552 let mut buf = [0u8; 1024];
24553 rng.fill_bytes(&mut buf);
24554 let mut unstructured = Unstructured::new(&buf);
24555 Self::arbitrary(&mut unstructured).unwrap_or_default()
24556 }
24557}
24558impl Default for PLAY_TUNE_DATA {
24559 fn default() -> Self {
24560 Self::DEFAULT.clone()
24561 }
24562}
24563impl MessageData for PLAY_TUNE_DATA {
24564 type Message = MavMessage;
24565 const ID: u32 = 258u32;
24566 const NAME: &'static str = "PLAY_TUNE";
24567 const EXTRA_CRC: u8 = 187u8;
24568 const ENCODED_LEN: usize = 232usize;
24569 fn deser(
24570 _version: MavlinkVersion,
24571 __input: &[u8],
24572 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24573 let avail_len = __input.len();
24574 let mut payload_buf = [0; Self::ENCODED_LEN];
24575 let mut buf = if avail_len < Self::ENCODED_LEN {
24576 payload_buf[0..avail_len].copy_from_slice(__input);
24577 Bytes::new(&payload_buf)
24578 } else {
24579 Bytes::new(__input)
24580 };
24581 let mut __struct = Self::default();
24582 __struct.target_system = buf.get_u8();
24583 __struct.target_component = buf.get_u8();
24584 let mut tmp = [0_u8; 30usize];
24585 for v in &mut tmp {
24586 *v = buf.get_u8();
24587 }
24588 __struct.tune = CharArray::new(tmp);
24589 let mut tmp = [0_u8; 200usize];
24590 for v in &mut tmp {
24591 *v = buf.get_u8();
24592 }
24593 __struct.tune2 = CharArray::new(tmp);
24594 Ok(__struct)
24595 }
24596 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24597 let mut __tmp = BytesMut::new(bytes);
24598 #[allow(clippy::absurd_extreme_comparisons)]
24599 #[allow(unused_comparisons)]
24600 if __tmp.remaining() < Self::ENCODED_LEN {
24601 panic!(
24602 "buffer is too small (need {} bytes, but got {})",
24603 Self::ENCODED_LEN,
24604 __tmp.remaining(),
24605 )
24606 }
24607 __tmp.put_u8(self.target_system);
24608 __tmp.put_u8(self.target_component);
24609 for val in &self.tune {
24610 __tmp.put_u8(*val);
24611 }
24612 if matches!(version, MavlinkVersion::V2) {
24613 for val in &self.tune2 {
24614 __tmp.put_u8(*val);
24615 }
24616 let len = __tmp.len();
24617 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24618 } else {
24619 __tmp.len()
24620 }
24621 }
24622}
24623#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
24624#[doc = ""]
24625#[doc = "ID: 400"]
24626#[derive(Debug, Clone, PartialEq)]
24627#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24628#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24629#[cfg_attr(feature = "ts", derive(TS))]
24630#[cfg_attr(feature = "ts", ts(export))]
24631pub struct PLAY_TUNE_V2_DATA {
24632 #[doc = "Tune format"]
24633 pub format: TuneFormat,
24634 #[doc = "System ID"]
24635 pub target_system: u8,
24636 #[doc = "Component ID"]
24637 pub target_component: u8,
24638 #[doc = "Tune definition as a NULL-terminated string."]
24639 #[cfg_attr(feature = "ts", ts(type = "string"))]
24640 pub tune: CharArray<248>,
24641}
24642impl PLAY_TUNE_V2_DATA {
24643 pub const ENCODED_LEN: usize = 254usize;
24644 pub const DEFAULT: Self = Self {
24645 format: TuneFormat::DEFAULT,
24646 target_system: 0_u8,
24647 target_component: 0_u8,
24648 tune: CharArray::new([0_u8; 248usize]),
24649 };
24650 #[cfg(feature = "arbitrary")]
24651 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24652 use arbitrary::{Arbitrary, Unstructured};
24653 let mut buf = [0u8; 1024];
24654 rng.fill_bytes(&mut buf);
24655 let mut unstructured = Unstructured::new(&buf);
24656 Self::arbitrary(&mut unstructured).unwrap_or_default()
24657 }
24658}
24659impl Default for PLAY_TUNE_V2_DATA {
24660 fn default() -> Self {
24661 Self::DEFAULT.clone()
24662 }
24663}
24664impl MessageData for PLAY_TUNE_V2_DATA {
24665 type Message = MavMessage;
24666 const ID: u32 = 400u32;
24667 const NAME: &'static str = "PLAY_TUNE_V2";
24668 const EXTRA_CRC: u8 = 110u8;
24669 const ENCODED_LEN: usize = 254usize;
24670 fn deser(
24671 _version: MavlinkVersion,
24672 __input: &[u8],
24673 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24674 let avail_len = __input.len();
24675 let mut payload_buf = [0; Self::ENCODED_LEN];
24676 let mut buf = if avail_len < Self::ENCODED_LEN {
24677 payload_buf[0..avail_len].copy_from_slice(__input);
24678 Bytes::new(&payload_buf)
24679 } else {
24680 Bytes::new(__input)
24681 };
24682 let mut __struct = Self::default();
24683 let tmp = buf.get_u32_le();
24684 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
24685 ::mavlink_core::error::ParserError::InvalidEnum {
24686 enum_type: "TuneFormat",
24687 value: tmp as u64,
24688 },
24689 )?;
24690 __struct.target_system = buf.get_u8();
24691 __struct.target_component = buf.get_u8();
24692 let mut tmp = [0_u8; 248usize];
24693 for v in &mut tmp {
24694 *v = buf.get_u8();
24695 }
24696 __struct.tune = CharArray::new(tmp);
24697 Ok(__struct)
24698 }
24699 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24700 let mut __tmp = BytesMut::new(bytes);
24701 #[allow(clippy::absurd_extreme_comparisons)]
24702 #[allow(unused_comparisons)]
24703 if __tmp.remaining() < Self::ENCODED_LEN {
24704 panic!(
24705 "buffer is too small (need {} bytes, but got {})",
24706 Self::ENCODED_LEN,
24707 __tmp.remaining(),
24708 )
24709 }
24710 __tmp.put_u32_le(self.format as u32);
24711 __tmp.put_u8(self.target_system);
24712 __tmp.put_u8(self.target_component);
24713 for val in &self.tune {
24714 __tmp.put_u8(*val);
24715 }
24716 if matches!(version, MavlinkVersion::V2) {
24717 let len = __tmp.len();
24718 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24719 } else {
24720 __tmp.len()
24721 }
24722 }
24723}
24724#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
24725#[doc = ""]
24726#[doc = "ID: 87"]
24727#[derive(Debug, Clone, PartialEq)]
24728#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24729#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24730#[cfg_attr(feature = "ts", derive(TS))]
24731#[cfg_attr(feature = "ts", ts(export))]
24732pub struct POSITION_TARGET_GLOBAL_INT_DATA {
24733 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
24734 pub time_boot_ms: u32,
24735 #[doc = "Latitude in WGS84 frame"]
24736 pub lat_int: i32,
24737 #[doc = "Longitude in WGS84 frame"]
24738 pub lon_int: i32,
24739 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
24740 pub alt: f32,
24741 #[doc = "X velocity in NED frame"]
24742 pub vx: f32,
24743 #[doc = "Y velocity in NED frame"]
24744 pub vy: f32,
24745 #[doc = "Z velocity in NED frame"]
24746 pub vz: f32,
24747 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24748 pub afx: f32,
24749 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24750 pub afy: f32,
24751 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24752 pub afz: f32,
24753 #[doc = "yaw setpoint"]
24754 pub yaw: f32,
24755 #[doc = "yaw rate setpoint"]
24756 pub yaw_rate: f32,
24757 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24758 pub type_mask: PositionTargetTypemask,
24759 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
24760 pub coordinate_frame: MavFrame,
24761}
24762impl POSITION_TARGET_GLOBAL_INT_DATA {
24763 pub const ENCODED_LEN: usize = 51usize;
24764 pub const DEFAULT: Self = Self {
24765 time_boot_ms: 0_u32,
24766 lat_int: 0_i32,
24767 lon_int: 0_i32,
24768 alt: 0.0_f32,
24769 vx: 0.0_f32,
24770 vy: 0.0_f32,
24771 vz: 0.0_f32,
24772 afx: 0.0_f32,
24773 afy: 0.0_f32,
24774 afz: 0.0_f32,
24775 yaw: 0.0_f32,
24776 yaw_rate: 0.0_f32,
24777 type_mask: PositionTargetTypemask::DEFAULT,
24778 coordinate_frame: MavFrame::DEFAULT,
24779 };
24780 #[cfg(feature = "arbitrary")]
24781 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24782 use arbitrary::{Arbitrary, Unstructured};
24783 let mut buf = [0u8; 1024];
24784 rng.fill_bytes(&mut buf);
24785 let mut unstructured = Unstructured::new(&buf);
24786 Self::arbitrary(&mut unstructured).unwrap_or_default()
24787 }
24788}
24789impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
24790 fn default() -> Self {
24791 Self::DEFAULT.clone()
24792 }
24793}
24794impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
24795 type Message = MavMessage;
24796 const ID: u32 = 87u32;
24797 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
24798 const EXTRA_CRC: u8 = 150u8;
24799 const ENCODED_LEN: usize = 51usize;
24800 fn deser(
24801 _version: MavlinkVersion,
24802 __input: &[u8],
24803 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24804 let avail_len = __input.len();
24805 let mut payload_buf = [0; Self::ENCODED_LEN];
24806 let mut buf = if avail_len < Self::ENCODED_LEN {
24807 payload_buf[0..avail_len].copy_from_slice(__input);
24808 Bytes::new(&payload_buf)
24809 } else {
24810 Bytes::new(__input)
24811 };
24812 let mut __struct = Self::default();
24813 __struct.time_boot_ms = buf.get_u32_le();
24814 __struct.lat_int = buf.get_i32_le();
24815 __struct.lon_int = buf.get_i32_le();
24816 __struct.alt = buf.get_f32_le();
24817 __struct.vx = buf.get_f32_le();
24818 __struct.vy = buf.get_f32_le();
24819 __struct.vz = buf.get_f32_le();
24820 __struct.afx = buf.get_f32_le();
24821 __struct.afy = buf.get_f32_le();
24822 __struct.afz = buf.get_f32_le();
24823 __struct.yaw = buf.get_f32_le();
24824 __struct.yaw_rate = buf.get_f32_le();
24825 let tmp = buf.get_u16_le();
24826 __struct.type_mask =
24827 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
24828 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24829 flag_type: "PositionTargetTypemask",
24830 value: tmp as u64,
24831 })?;
24832 let tmp = buf.get_u8();
24833 __struct.coordinate_frame =
24834 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24835 enum_type: "MavFrame",
24836 value: tmp as u64,
24837 })?;
24838 Ok(__struct)
24839 }
24840 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24841 let mut __tmp = BytesMut::new(bytes);
24842 #[allow(clippy::absurd_extreme_comparisons)]
24843 #[allow(unused_comparisons)]
24844 if __tmp.remaining() < Self::ENCODED_LEN {
24845 panic!(
24846 "buffer is too small (need {} bytes, but got {})",
24847 Self::ENCODED_LEN,
24848 __tmp.remaining(),
24849 )
24850 }
24851 __tmp.put_u32_le(self.time_boot_ms);
24852 __tmp.put_i32_le(self.lat_int);
24853 __tmp.put_i32_le(self.lon_int);
24854 __tmp.put_f32_le(self.alt);
24855 __tmp.put_f32_le(self.vx);
24856 __tmp.put_f32_le(self.vy);
24857 __tmp.put_f32_le(self.vz);
24858 __tmp.put_f32_le(self.afx);
24859 __tmp.put_f32_le(self.afy);
24860 __tmp.put_f32_le(self.afz);
24861 __tmp.put_f32_le(self.yaw);
24862 __tmp.put_f32_le(self.yaw_rate);
24863 __tmp.put_u16_le(self.type_mask.bits() as u16);
24864 __tmp.put_u8(self.coordinate_frame as u8);
24865 if matches!(version, MavlinkVersion::V2) {
24866 let len = __tmp.len();
24867 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24868 } else {
24869 __tmp.len()
24870 }
24871 }
24872}
24873#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
24874#[doc = ""]
24875#[doc = "ID: 85"]
24876#[derive(Debug, Clone, PartialEq)]
24877#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24878#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24879#[cfg_attr(feature = "ts", derive(TS))]
24880#[cfg_attr(feature = "ts", ts(export))]
24881pub struct POSITION_TARGET_LOCAL_NED_DATA {
24882 #[doc = "Timestamp (time since system boot)."]
24883 pub time_boot_ms: u32,
24884 #[doc = "X Position in NED frame"]
24885 pub x: f32,
24886 #[doc = "Y Position in NED frame"]
24887 pub y: f32,
24888 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
24889 pub z: f32,
24890 #[doc = "X velocity in NED frame"]
24891 pub vx: f32,
24892 #[doc = "Y velocity in NED frame"]
24893 pub vy: f32,
24894 #[doc = "Z velocity in NED frame"]
24895 pub vz: f32,
24896 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24897 pub afx: f32,
24898 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24899 pub afy: f32,
24900 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24901 pub afz: f32,
24902 #[doc = "yaw setpoint"]
24903 pub yaw: f32,
24904 #[doc = "yaw rate setpoint"]
24905 pub yaw_rate: f32,
24906 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24907 pub type_mask: PositionTargetTypemask,
24908 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
24909 pub coordinate_frame: MavFrame,
24910}
24911impl POSITION_TARGET_LOCAL_NED_DATA {
24912 pub const ENCODED_LEN: usize = 51usize;
24913 pub const DEFAULT: Self = Self {
24914 time_boot_ms: 0_u32,
24915 x: 0.0_f32,
24916 y: 0.0_f32,
24917 z: 0.0_f32,
24918 vx: 0.0_f32,
24919 vy: 0.0_f32,
24920 vz: 0.0_f32,
24921 afx: 0.0_f32,
24922 afy: 0.0_f32,
24923 afz: 0.0_f32,
24924 yaw: 0.0_f32,
24925 yaw_rate: 0.0_f32,
24926 type_mask: PositionTargetTypemask::DEFAULT,
24927 coordinate_frame: MavFrame::DEFAULT,
24928 };
24929 #[cfg(feature = "arbitrary")]
24930 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24931 use arbitrary::{Arbitrary, Unstructured};
24932 let mut buf = [0u8; 1024];
24933 rng.fill_bytes(&mut buf);
24934 let mut unstructured = Unstructured::new(&buf);
24935 Self::arbitrary(&mut unstructured).unwrap_or_default()
24936 }
24937}
24938impl Default for POSITION_TARGET_LOCAL_NED_DATA {
24939 fn default() -> Self {
24940 Self::DEFAULT.clone()
24941 }
24942}
24943impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
24944 type Message = MavMessage;
24945 const ID: u32 = 85u32;
24946 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
24947 const EXTRA_CRC: u8 = 140u8;
24948 const ENCODED_LEN: usize = 51usize;
24949 fn deser(
24950 _version: MavlinkVersion,
24951 __input: &[u8],
24952 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24953 let avail_len = __input.len();
24954 let mut payload_buf = [0; Self::ENCODED_LEN];
24955 let mut buf = if avail_len < Self::ENCODED_LEN {
24956 payload_buf[0..avail_len].copy_from_slice(__input);
24957 Bytes::new(&payload_buf)
24958 } else {
24959 Bytes::new(__input)
24960 };
24961 let mut __struct = Self::default();
24962 __struct.time_boot_ms = buf.get_u32_le();
24963 __struct.x = buf.get_f32_le();
24964 __struct.y = buf.get_f32_le();
24965 __struct.z = buf.get_f32_le();
24966 __struct.vx = buf.get_f32_le();
24967 __struct.vy = buf.get_f32_le();
24968 __struct.vz = buf.get_f32_le();
24969 __struct.afx = buf.get_f32_le();
24970 __struct.afy = buf.get_f32_le();
24971 __struct.afz = buf.get_f32_le();
24972 __struct.yaw = buf.get_f32_le();
24973 __struct.yaw_rate = buf.get_f32_le();
24974 let tmp = buf.get_u16_le();
24975 __struct.type_mask =
24976 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
24977 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24978 flag_type: "PositionTargetTypemask",
24979 value: tmp as u64,
24980 })?;
24981 let tmp = buf.get_u8();
24982 __struct.coordinate_frame =
24983 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24984 enum_type: "MavFrame",
24985 value: tmp as u64,
24986 })?;
24987 Ok(__struct)
24988 }
24989 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24990 let mut __tmp = BytesMut::new(bytes);
24991 #[allow(clippy::absurd_extreme_comparisons)]
24992 #[allow(unused_comparisons)]
24993 if __tmp.remaining() < Self::ENCODED_LEN {
24994 panic!(
24995 "buffer is too small (need {} bytes, but got {})",
24996 Self::ENCODED_LEN,
24997 __tmp.remaining(),
24998 )
24999 }
25000 __tmp.put_u32_le(self.time_boot_ms);
25001 __tmp.put_f32_le(self.x);
25002 __tmp.put_f32_le(self.y);
25003 __tmp.put_f32_le(self.z);
25004 __tmp.put_f32_le(self.vx);
25005 __tmp.put_f32_le(self.vy);
25006 __tmp.put_f32_le(self.vz);
25007 __tmp.put_f32_le(self.afx);
25008 __tmp.put_f32_le(self.afy);
25009 __tmp.put_f32_le(self.afz);
25010 __tmp.put_f32_le(self.yaw);
25011 __tmp.put_f32_le(self.yaw_rate);
25012 __tmp.put_u16_le(self.type_mask.bits() as u16);
25013 __tmp.put_u8(self.coordinate_frame as u8);
25014 if matches!(version, MavlinkVersion::V2) {
25015 let len = __tmp.len();
25016 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25017 } else {
25018 __tmp.len()
25019 }
25020 }
25021}
25022#[doc = "Power supply status."]
25023#[doc = ""]
25024#[doc = "ID: 125"]
25025#[derive(Debug, Clone, PartialEq)]
25026#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25027#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25028#[cfg_attr(feature = "ts", derive(TS))]
25029#[cfg_attr(feature = "ts", ts(export))]
25030pub struct POWER_STATUS_DATA {
25031 #[doc = "5V rail voltage."]
25032 pub Vcc: u16,
25033 #[doc = "Servo rail voltage."]
25034 pub Vservo: u16,
25035 #[doc = "Bitmap of power supply status flags."]
25036 pub flags: MavPowerStatus,
25037}
25038impl POWER_STATUS_DATA {
25039 pub const ENCODED_LEN: usize = 6usize;
25040 pub const DEFAULT: Self = Self {
25041 Vcc: 0_u16,
25042 Vservo: 0_u16,
25043 flags: MavPowerStatus::DEFAULT,
25044 };
25045 #[cfg(feature = "arbitrary")]
25046 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25047 use arbitrary::{Arbitrary, Unstructured};
25048 let mut buf = [0u8; 1024];
25049 rng.fill_bytes(&mut buf);
25050 let mut unstructured = Unstructured::new(&buf);
25051 Self::arbitrary(&mut unstructured).unwrap_or_default()
25052 }
25053}
25054impl Default for POWER_STATUS_DATA {
25055 fn default() -> Self {
25056 Self::DEFAULT.clone()
25057 }
25058}
25059impl MessageData for POWER_STATUS_DATA {
25060 type Message = MavMessage;
25061 const ID: u32 = 125u32;
25062 const NAME: &'static str = "POWER_STATUS";
25063 const EXTRA_CRC: u8 = 203u8;
25064 const ENCODED_LEN: usize = 6usize;
25065 fn deser(
25066 _version: MavlinkVersion,
25067 __input: &[u8],
25068 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25069 let avail_len = __input.len();
25070 let mut payload_buf = [0; Self::ENCODED_LEN];
25071 let mut buf = if avail_len < Self::ENCODED_LEN {
25072 payload_buf[0..avail_len].copy_from_slice(__input);
25073 Bytes::new(&payload_buf)
25074 } else {
25075 Bytes::new(__input)
25076 };
25077 let mut __struct = Self::default();
25078 __struct.Vcc = buf.get_u16_le();
25079 __struct.Vservo = buf.get_u16_le();
25080 let tmp = buf.get_u16_le();
25081 __struct.flags = MavPowerStatus::from_bits(tmp as <MavPowerStatus as Flags>::Bits).ok_or(
25082 ::mavlink_core::error::ParserError::InvalidFlag {
25083 flag_type: "MavPowerStatus",
25084 value: tmp as u64,
25085 },
25086 )?;
25087 Ok(__struct)
25088 }
25089 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25090 let mut __tmp = BytesMut::new(bytes);
25091 #[allow(clippy::absurd_extreme_comparisons)]
25092 #[allow(unused_comparisons)]
25093 if __tmp.remaining() < Self::ENCODED_LEN {
25094 panic!(
25095 "buffer is too small (need {} bytes, but got {})",
25096 Self::ENCODED_LEN,
25097 __tmp.remaining(),
25098 )
25099 }
25100 __tmp.put_u16_le(self.Vcc);
25101 __tmp.put_u16_le(self.Vservo);
25102 __tmp.put_u16_le(self.flags.bits() as u16);
25103 if matches!(version, MavlinkVersion::V2) {
25104 let len = __tmp.len();
25105 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25106 } else {
25107 __tmp.len()
25108 }
25109 }
25110}
25111#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
25112#[doc = ""]
25113#[doc = "ID: 300"]
25114#[derive(Debug, Clone, PartialEq)]
25115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25116#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25117#[cfg_attr(feature = "ts", derive(TS))]
25118#[cfg_attr(feature = "ts", ts(export))]
25119pub struct PROTOCOL_VERSION_DATA {
25120 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
25121 pub version: u16,
25122 #[doc = "Minimum MAVLink version supported"]
25123 pub min_version: u16,
25124 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
25125 pub max_version: u16,
25126 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25127 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25128 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25129 pub spec_version_hash: [u8; 8],
25130 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25131 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25132 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25133 pub library_version_hash: [u8; 8],
25134}
25135impl PROTOCOL_VERSION_DATA {
25136 pub const ENCODED_LEN: usize = 22usize;
25137 pub const DEFAULT: Self = Self {
25138 version: 0_u16,
25139 min_version: 0_u16,
25140 max_version: 0_u16,
25141 spec_version_hash: [0_u8; 8usize],
25142 library_version_hash: [0_u8; 8usize],
25143 };
25144 #[cfg(feature = "arbitrary")]
25145 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25146 use arbitrary::{Arbitrary, Unstructured};
25147 let mut buf = [0u8; 1024];
25148 rng.fill_bytes(&mut buf);
25149 let mut unstructured = Unstructured::new(&buf);
25150 Self::arbitrary(&mut unstructured).unwrap_or_default()
25151 }
25152}
25153impl Default for PROTOCOL_VERSION_DATA {
25154 fn default() -> Self {
25155 Self::DEFAULT.clone()
25156 }
25157}
25158impl MessageData for PROTOCOL_VERSION_DATA {
25159 type Message = MavMessage;
25160 const ID: u32 = 300u32;
25161 const NAME: &'static str = "PROTOCOL_VERSION";
25162 const EXTRA_CRC: u8 = 217u8;
25163 const ENCODED_LEN: usize = 22usize;
25164 fn deser(
25165 _version: MavlinkVersion,
25166 __input: &[u8],
25167 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25168 let avail_len = __input.len();
25169 let mut payload_buf = [0; Self::ENCODED_LEN];
25170 let mut buf = if avail_len < Self::ENCODED_LEN {
25171 payload_buf[0..avail_len].copy_from_slice(__input);
25172 Bytes::new(&payload_buf)
25173 } else {
25174 Bytes::new(__input)
25175 };
25176 let mut __struct = Self::default();
25177 __struct.version = buf.get_u16_le();
25178 __struct.min_version = buf.get_u16_le();
25179 __struct.max_version = buf.get_u16_le();
25180 for v in &mut __struct.spec_version_hash {
25181 let val = buf.get_u8();
25182 *v = val;
25183 }
25184 for v in &mut __struct.library_version_hash {
25185 let val = buf.get_u8();
25186 *v = val;
25187 }
25188 Ok(__struct)
25189 }
25190 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25191 let mut __tmp = BytesMut::new(bytes);
25192 #[allow(clippy::absurd_extreme_comparisons)]
25193 #[allow(unused_comparisons)]
25194 if __tmp.remaining() < Self::ENCODED_LEN {
25195 panic!(
25196 "buffer is too small (need {} bytes, but got {})",
25197 Self::ENCODED_LEN,
25198 __tmp.remaining(),
25199 )
25200 }
25201 __tmp.put_u16_le(self.version);
25202 __tmp.put_u16_le(self.min_version);
25203 __tmp.put_u16_le(self.max_version);
25204 for val in &self.spec_version_hash {
25205 __tmp.put_u8(*val);
25206 }
25207 for val in &self.library_version_hash {
25208 __tmp.put_u8(*val);
25209 }
25210 if matches!(version, MavlinkVersion::V2) {
25211 let len = __tmp.len();
25212 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25213 } else {
25214 __tmp.len()
25215 }
25216 }
25217}
25218#[doc = "Status generated by radio and injected into MAVLink stream."]
25219#[doc = ""]
25220#[doc = "ID: 109"]
25221#[derive(Debug, Clone, PartialEq)]
25222#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25223#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25224#[cfg_attr(feature = "ts", derive(TS))]
25225#[cfg_attr(feature = "ts", ts(export))]
25226pub struct RADIO_STATUS_DATA {
25227 #[doc = "Count of radio packet receive errors (since boot)."]
25228 pub rxerrors: u16,
25229 #[doc = "Count of error corrected radio packets (since boot)."]
25230 pub fixed: u16,
25231 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25232 pub rssi: u8,
25233 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25234 pub remrssi: u8,
25235 #[doc = "Remaining free transmitter buffer space."]
25236 pub txbuf: u8,
25237 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25238 pub noise: u8,
25239 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25240 pub remnoise: u8,
25241}
25242impl RADIO_STATUS_DATA {
25243 pub const ENCODED_LEN: usize = 9usize;
25244 pub const DEFAULT: Self = Self {
25245 rxerrors: 0_u16,
25246 fixed: 0_u16,
25247 rssi: 0_u8,
25248 remrssi: 0_u8,
25249 txbuf: 0_u8,
25250 noise: 0_u8,
25251 remnoise: 0_u8,
25252 };
25253 #[cfg(feature = "arbitrary")]
25254 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25255 use arbitrary::{Arbitrary, Unstructured};
25256 let mut buf = [0u8; 1024];
25257 rng.fill_bytes(&mut buf);
25258 let mut unstructured = Unstructured::new(&buf);
25259 Self::arbitrary(&mut unstructured).unwrap_or_default()
25260 }
25261}
25262impl Default for RADIO_STATUS_DATA {
25263 fn default() -> Self {
25264 Self::DEFAULT.clone()
25265 }
25266}
25267impl MessageData for RADIO_STATUS_DATA {
25268 type Message = MavMessage;
25269 const ID: u32 = 109u32;
25270 const NAME: &'static str = "RADIO_STATUS";
25271 const EXTRA_CRC: u8 = 185u8;
25272 const ENCODED_LEN: usize = 9usize;
25273 fn deser(
25274 _version: MavlinkVersion,
25275 __input: &[u8],
25276 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25277 let avail_len = __input.len();
25278 let mut payload_buf = [0; Self::ENCODED_LEN];
25279 let mut buf = if avail_len < Self::ENCODED_LEN {
25280 payload_buf[0..avail_len].copy_from_slice(__input);
25281 Bytes::new(&payload_buf)
25282 } else {
25283 Bytes::new(__input)
25284 };
25285 let mut __struct = Self::default();
25286 __struct.rxerrors = buf.get_u16_le();
25287 __struct.fixed = buf.get_u16_le();
25288 __struct.rssi = buf.get_u8();
25289 __struct.remrssi = buf.get_u8();
25290 __struct.txbuf = buf.get_u8();
25291 __struct.noise = buf.get_u8();
25292 __struct.remnoise = buf.get_u8();
25293 Ok(__struct)
25294 }
25295 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25296 let mut __tmp = BytesMut::new(bytes);
25297 #[allow(clippy::absurd_extreme_comparisons)]
25298 #[allow(unused_comparisons)]
25299 if __tmp.remaining() < Self::ENCODED_LEN {
25300 panic!(
25301 "buffer is too small (need {} bytes, but got {})",
25302 Self::ENCODED_LEN,
25303 __tmp.remaining(),
25304 )
25305 }
25306 __tmp.put_u16_le(self.rxerrors);
25307 __tmp.put_u16_le(self.fixed);
25308 __tmp.put_u8(self.rssi);
25309 __tmp.put_u8(self.remrssi);
25310 __tmp.put_u8(self.txbuf);
25311 __tmp.put_u8(self.noise);
25312 __tmp.put_u8(self.remnoise);
25313 if matches!(version, MavlinkVersion::V2) {
25314 let len = __tmp.len();
25315 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25316 } else {
25317 __tmp.len()
25318 }
25319 }
25320}
25321#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
25322#[doc = ""]
25323#[doc = "ID: 27"]
25324#[derive(Debug, Clone, PartialEq)]
25325#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25326#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25327#[cfg_attr(feature = "ts", derive(TS))]
25328#[cfg_attr(feature = "ts", ts(export))]
25329pub struct RAW_IMU_DATA {
25330 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25331 pub time_usec: u64,
25332 #[doc = "X acceleration (raw)"]
25333 pub xacc: i16,
25334 #[doc = "Y acceleration (raw)"]
25335 pub yacc: i16,
25336 #[doc = "Z acceleration (raw)"]
25337 pub zacc: i16,
25338 #[doc = "Angular speed around X axis (raw)"]
25339 pub xgyro: i16,
25340 #[doc = "Angular speed around Y axis (raw)"]
25341 pub ygyro: i16,
25342 #[doc = "Angular speed around Z axis (raw)"]
25343 pub zgyro: i16,
25344 #[doc = "X Magnetic field (raw)"]
25345 pub xmag: i16,
25346 #[doc = "Y Magnetic field (raw)"]
25347 pub ymag: i16,
25348 #[doc = "Z Magnetic field (raw)"]
25349 pub zmag: i16,
25350 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
25351 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25352 pub id: u8,
25353 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25354 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25355 pub temperature: i16,
25356}
25357impl RAW_IMU_DATA {
25358 pub const ENCODED_LEN: usize = 29usize;
25359 pub const DEFAULT: Self = Self {
25360 time_usec: 0_u64,
25361 xacc: 0_i16,
25362 yacc: 0_i16,
25363 zacc: 0_i16,
25364 xgyro: 0_i16,
25365 ygyro: 0_i16,
25366 zgyro: 0_i16,
25367 xmag: 0_i16,
25368 ymag: 0_i16,
25369 zmag: 0_i16,
25370 id: 0_u8,
25371 temperature: 0_i16,
25372 };
25373 #[cfg(feature = "arbitrary")]
25374 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25375 use arbitrary::{Arbitrary, Unstructured};
25376 let mut buf = [0u8; 1024];
25377 rng.fill_bytes(&mut buf);
25378 let mut unstructured = Unstructured::new(&buf);
25379 Self::arbitrary(&mut unstructured).unwrap_or_default()
25380 }
25381}
25382impl Default for RAW_IMU_DATA {
25383 fn default() -> Self {
25384 Self::DEFAULT.clone()
25385 }
25386}
25387impl MessageData for RAW_IMU_DATA {
25388 type Message = MavMessage;
25389 const ID: u32 = 27u32;
25390 const NAME: &'static str = "RAW_IMU";
25391 const EXTRA_CRC: u8 = 144u8;
25392 const ENCODED_LEN: usize = 29usize;
25393 fn deser(
25394 _version: MavlinkVersion,
25395 __input: &[u8],
25396 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25397 let avail_len = __input.len();
25398 let mut payload_buf = [0; Self::ENCODED_LEN];
25399 let mut buf = if avail_len < Self::ENCODED_LEN {
25400 payload_buf[0..avail_len].copy_from_slice(__input);
25401 Bytes::new(&payload_buf)
25402 } else {
25403 Bytes::new(__input)
25404 };
25405 let mut __struct = Self::default();
25406 __struct.time_usec = buf.get_u64_le();
25407 __struct.xacc = buf.get_i16_le();
25408 __struct.yacc = buf.get_i16_le();
25409 __struct.zacc = buf.get_i16_le();
25410 __struct.xgyro = buf.get_i16_le();
25411 __struct.ygyro = buf.get_i16_le();
25412 __struct.zgyro = buf.get_i16_le();
25413 __struct.xmag = buf.get_i16_le();
25414 __struct.ymag = buf.get_i16_le();
25415 __struct.zmag = buf.get_i16_le();
25416 __struct.id = buf.get_u8();
25417 __struct.temperature = buf.get_i16_le();
25418 Ok(__struct)
25419 }
25420 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25421 let mut __tmp = BytesMut::new(bytes);
25422 #[allow(clippy::absurd_extreme_comparisons)]
25423 #[allow(unused_comparisons)]
25424 if __tmp.remaining() < Self::ENCODED_LEN {
25425 panic!(
25426 "buffer is too small (need {} bytes, but got {})",
25427 Self::ENCODED_LEN,
25428 __tmp.remaining(),
25429 )
25430 }
25431 __tmp.put_u64_le(self.time_usec);
25432 __tmp.put_i16_le(self.xacc);
25433 __tmp.put_i16_le(self.yacc);
25434 __tmp.put_i16_le(self.zacc);
25435 __tmp.put_i16_le(self.xgyro);
25436 __tmp.put_i16_le(self.ygyro);
25437 __tmp.put_i16_le(self.zgyro);
25438 __tmp.put_i16_le(self.xmag);
25439 __tmp.put_i16_le(self.ymag);
25440 __tmp.put_i16_le(self.zmag);
25441 if matches!(version, MavlinkVersion::V2) {
25442 __tmp.put_u8(self.id);
25443 __tmp.put_i16_le(self.temperature);
25444 let len = __tmp.len();
25445 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25446 } else {
25447 __tmp.len()
25448 }
25449 }
25450}
25451#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
25452#[doc = ""]
25453#[doc = "ID: 28"]
25454#[derive(Debug, Clone, PartialEq)]
25455#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25456#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25457#[cfg_attr(feature = "ts", derive(TS))]
25458#[cfg_attr(feature = "ts", ts(export))]
25459pub struct RAW_PRESSURE_DATA {
25460 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25461 pub time_usec: u64,
25462 #[doc = "Absolute pressure (raw)"]
25463 pub press_abs: i16,
25464 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
25465 pub press_diff1: i16,
25466 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
25467 pub press_diff2: i16,
25468 #[doc = "Raw Temperature measurement (raw)"]
25469 pub temperature: i16,
25470}
25471impl RAW_PRESSURE_DATA {
25472 pub const ENCODED_LEN: usize = 16usize;
25473 pub const DEFAULT: Self = Self {
25474 time_usec: 0_u64,
25475 press_abs: 0_i16,
25476 press_diff1: 0_i16,
25477 press_diff2: 0_i16,
25478 temperature: 0_i16,
25479 };
25480 #[cfg(feature = "arbitrary")]
25481 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25482 use arbitrary::{Arbitrary, Unstructured};
25483 let mut buf = [0u8; 1024];
25484 rng.fill_bytes(&mut buf);
25485 let mut unstructured = Unstructured::new(&buf);
25486 Self::arbitrary(&mut unstructured).unwrap_or_default()
25487 }
25488}
25489impl Default for RAW_PRESSURE_DATA {
25490 fn default() -> Self {
25491 Self::DEFAULT.clone()
25492 }
25493}
25494impl MessageData for RAW_PRESSURE_DATA {
25495 type Message = MavMessage;
25496 const ID: u32 = 28u32;
25497 const NAME: &'static str = "RAW_PRESSURE";
25498 const EXTRA_CRC: u8 = 67u8;
25499 const ENCODED_LEN: usize = 16usize;
25500 fn deser(
25501 _version: MavlinkVersion,
25502 __input: &[u8],
25503 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25504 let avail_len = __input.len();
25505 let mut payload_buf = [0; Self::ENCODED_LEN];
25506 let mut buf = if avail_len < Self::ENCODED_LEN {
25507 payload_buf[0..avail_len].copy_from_slice(__input);
25508 Bytes::new(&payload_buf)
25509 } else {
25510 Bytes::new(__input)
25511 };
25512 let mut __struct = Self::default();
25513 __struct.time_usec = buf.get_u64_le();
25514 __struct.press_abs = buf.get_i16_le();
25515 __struct.press_diff1 = buf.get_i16_le();
25516 __struct.press_diff2 = buf.get_i16_le();
25517 __struct.temperature = buf.get_i16_le();
25518 Ok(__struct)
25519 }
25520 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25521 let mut __tmp = BytesMut::new(bytes);
25522 #[allow(clippy::absurd_extreme_comparisons)]
25523 #[allow(unused_comparisons)]
25524 if __tmp.remaining() < Self::ENCODED_LEN {
25525 panic!(
25526 "buffer is too small (need {} bytes, but got {})",
25527 Self::ENCODED_LEN,
25528 __tmp.remaining(),
25529 )
25530 }
25531 __tmp.put_u64_le(self.time_usec);
25532 __tmp.put_i16_le(self.press_abs);
25533 __tmp.put_i16_le(self.press_diff1);
25534 __tmp.put_i16_le(self.press_diff2);
25535 __tmp.put_i16_le(self.temperature);
25536 if matches!(version, MavlinkVersion::V2) {
25537 let len = __tmp.len();
25538 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25539 } else {
25540 __tmp.len()
25541 }
25542 }
25543}
25544#[doc = "RPM sensor data message."]
25545#[doc = ""]
25546#[doc = "ID: 339"]
25547#[derive(Debug, Clone, PartialEq)]
25548#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25549#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25550#[cfg_attr(feature = "ts", derive(TS))]
25551#[cfg_attr(feature = "ts", ts(export))]
25552pub struct RAW_RPM_DATA {
25553 #[doc = "Indicated rate"]
25554 pub frequency: f32,
25555 #[doc = "Index of this RPM sensor (0-indexed)"]
25556 pub index: u8,
25557}
25558impl RAW_RPM_DATA {
25559 pub const ENCODED_LEN: usize = 5usize;
25560 pub const DEFAULT: Self = Self {
25561 frequency: 0.0_f32,
25562 index: 0_u8,
25563 };
25564 #[cfg(feature = "arbitrary")]
25565 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25566 use arbitrary::{Arbitrary, Unstructured};
25567 let mut buf = [0u8; 1024];
25568 rng.fill_bytes(&mut buf);
25569 let mut unstructured = Unstructured::new(&buf);
25570 Self::arbitrary(&mut unstructured).unwrap_or_default()
25571 }
25572}
25573impl Default for RAW_RPM_DATA {
25574 fn default() -> Self {
25575 Self::DEFAULT.clone()
25576 }
25577}
25578impl MessageData for RAW_RPM_DATA {
25579 type Message = MavMessage;
25580 const ID: u32 = 339u32;
25581 const NAME: &'static str = "RAW_RPM";
25582 const EXTRA_CRC: u8 = 199u8;
25583 const ENCODED_LEN: usize = 5usize;
25584 fn deser(
25585 _version: MavlinkVersion,
25586 __input: &[u8],
25587 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25588 let avail_len = __input.len();
25589 let mut payload_buf = [0; Self::ENCODED_LEN];
25590 let mut buf = if avail_len < Self::ENCODED_LEN {
25591 payload_buf[0..avail_len].copy_from_slice(__input);
25592 Bytes::new(&payload_buf)
25593 } else {
25594 Bytes::new(__input)
25595 };
25596 let mut __struct = Self::default();
25597 __struct.frequency = buf.get_f32_le();
25598 __struct.index = buf.get_u8();
25599 Ok(__struct)
25600 }
25601 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25602 let mut __tmp = BytesMut::new(bytes);
25603 #[allow(clippy::absurd_extreme_comparisons)]
25604 #[allow(unused_comparisons)]
25605 if __tmp.remaining() < Self::ENCODED_LEN {
25606 panic!(
25607 "buffer is too small (need {} bytes, but got {})",
25608 Self::ENCODED_LEN,
25609 __tmp.remaining(),
25610 )
25611 }
25612 __tmp.put_f32_le(self.frequency);
25613 __tmp.put_u8(self.index);
25614 if matches!(version, MavlinkVersion::V2) {
25615 let len = __tmp.len();
25616 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25617 } else {
25618 __tmp.len()
25619 }
25620 }
25621}
25622#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25623#[doc = ""]
25624#[doc = "ID: 65"]
25625#[derive(Debug, Clone, PartialEq)]
25626#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25627#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25628#[cfg_attr(feature = "ts", derive(TS))]
25629#[cfg_attr(feature = "ts", ts(export))]
25630pub struct RC_CHANNELS_DATA {
25631 #[doc = "Timestamp (time since system boot)."]
25632 pub time_boot_ms: u32,
25633 #[doc = "RC channel 1 value."]
25634 pub chan1_raw: u16,
25635 #[doc = "RC channel 2 value."]
25636 pub chan2_raw: u16,
25637 #[doc = "RC channel 3 value."]
25638 pub chan3_raw: u16,
25639 #[doc = "RC channel 4 value."]
25640 pub chan4_raw: u16,
25641 #[doc = "RC channel 5 value."]
25642 pub chan5_raw: u16,
25643 #[doc = "RC channel 6 value."]
25644 pub chan6_raw: u16,
25645 #[doc = "RC channel 7 value."]
25646 pub chan7_raw: u16,
25647 #[doc = "RC channel 8 value."]
25648 pub chan8_raw: u16,
25649 #[doc = "RC channel 9 value."]
25650 pub chan9_raw: u16,
25651 #[doc = "RC channel 10 value."]
25652 pub chan10_raw: u16,
25653 #[doc = "RC channel 11 value."]
25654 pub chan11_raw: u16,
25655 #[doc = "RC channel 12 value."]
25656 pub chan12_raw: u16,
25657 #[doc = "RC channel 13 value."]
25658 pub chan13_raw: u16,
25659 #[doc = "RC channel 14 value."]
25660 pub chan14_raw: u16,
25661 #[doc = "RC channel 15 value."]
25662 pub chan15_raw: u16,
25663 #[doc = "RC channel 16 value."]
25664 pub chan16_raw: u16,
25665 #[doc = "RC channel 17 value."]
25666 pub chan17_raw: u16,
25667 #[doc = "RC channel 18 value."]
25668 pub chan18_raw: u16,
25669 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
25670 pub chancount: u8,
25671 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25672 pub rssi: u8,
25673}
25674impl RC_CHANNELS_DATA {
25675 pub const ENCODED_LEN: usize = 42usize;
25676 pub const DEFAULT: Self = Self {
25677 time_boot_ms: 0_u32,
25678 chan1_raw: 0_u16,
25679 chan2_raw: 0_u16,
25680 chan3_raw: 0_u16,
25681 chan4_raw: 0_u16,
25682 chan5_raw: 0_u16,
25683 chan6_raw: 0_u16,
25684 chan7_raw: 0_u16,
25685 chan8_raw: 0_u16,
25686 chan9_raw: 0_u16,
25687 chan10_raw: 0_u16,
25688 chan11_raw: 0_u16,
25689 chan12_raw: 0_u16,
25690 chan13_raw: 0_u16,
25691 chan14_raw: 0_u16,
25692 chan15_raw: 0_u16,
25693 chan16_raw: 0_u16,
25694 chan17_raw: 0_u16,
25695 chan18_raw: 0_u16,
25696 chancount: 0_u8,
25697 rssi: 0_u8,
25698 };
25699 #[cfg(feature = "arbitrary")]
25700 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25701 use arbitrary::{Arbitrary, Unstructured};
25702 let mut buf = [0u8; 1024];
25703 rng.fill_bytes(&mut buf);
25704 let mut unstructured = Unstructured::new(&buf);
25705 Self::arbitrary(&mut unstructured).unwrap_or_default()
25706 }
25707}
25708impl Default for RC_CHANNELS_DATA {
25709 fn default() -> Self {
25710 Self::DEFAULT.clone()
25711 }
25712}
25713impl MessageData for RC_CHANNELS_DATA {
25714 type Message = MavMessage;
25715 const ID: u32 = 65u32;
25716 const NAME: &'static str = "RC_CHANNELS";
25717 const EXTRA_CRC: u8 = 118u8;
25718 const ENCODED_LEN: usize = 42usize;
25719 fn deser(
25720 _version: MavlinkVersion,
25721 __input: &[u8],
25722 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25723 let avail_len = __input.len();
25724 let mut payload_buf = [0; Self::ENCODED_LEN];
25725 let mut buf = if avail_len < Self::ENCODED_LEN {
25726 payload_buf[0..avail_len].copy_from_slice(__input);
25727 Bytes::new(&payload_buf)
25728 } else {
25729 Bytes::new(__input)
25730 };
25731 let mut __struct = Self::default();
25732 __struct.time_boot_ms = buf.get_u32_le();
25733 __struct.chan1_raw = buf.get_u16_le();
25734 __struct.chan2_raw = buf.get_u16_le();
25735 __struct.chan3_raw = buf.get_u16_le();
25736 __struct.chan4_raw = buf.get_u16_le();
25737 __struct.chan5_raw = buf.get_u16_le();
25738 __struct.chan6_raw = buf.get_u16_le();
25739 __struct.chan7_raw = buf.get_u16_le();
25740 __struct.chan8_raw = buf.get_u16_le();
25741 __struct.chan9_raw = buf.get_u16_le();
25742 __struct.chan10_raw = buf.get_u16_le();
25743 __struct.chan11_raw = buf.get_u16_le();
25744 __struct.chan12_raw = buf.get_u16_le();
25745 __struct.chan13_raw = buf.get_u16_le();
25746 __struct.chan14_raw = buf.get_u16_le();
25747 __struct.chan15_raw = buf.get_u16_le();
25748 __struct.chan16_raw = buf.get_u16_le();
25749 __struct.chan17_raw = buf.get_u16_le();
25750 __struct.chan18_raw = buf.get_u16_le();
25751 __struct.chancount = buf.get_u8();
25752 __struct.rssi = buf.get_u8();
25753 Ok(__struct)
25754 }
25755 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25756 let mut __tmp = BytesMut::new(bytes);
25757 #[allow(clippy::absurd_extreme_comparisons)]
25758 #[allow(unused_comparisons)]
25759 if __tmp.remaining() < Self::ENCODED_LEN {
25760 panic!(
25761 "buffer is too small (need {} bytes, but got {})",
25762 Self::ENCODED_LEN,
25763 __tmp.remaining(),
25764 )
25765 }
25766 __tmp.put_u32_le(self.time_boot_ms);
25767 __tmp.put_u16_le(self.chan1_raw);
25768 __tmp.put_u16_le(self.chan2_raw);
25769 __tmp.put_u16_le(self.chan3_raw);
25770 __tmp.put_u16_le(self.chan4_raw);
25771 __tmp.put_u16_le(self.chan5_raw);
25772 __tmp.put_u16_le(self.chan6_raw);
25773 __tmp.put_u16_le(self.chan7_raw);
25774 __tmp.put_u16_le(self.chan8_raw);
25775 __tmp.put_u16_le(self.chan9_raw);
25776 __tmp.put_u16_le(self.chan10_raw);
25777 __tmp.put_u16_le(self.chan11_raw);
25778 __tmp.put_u16_le(self.chan12_raw);
25779 __tmp.put_u16_le(self.chan13_raw);
25780 __tmp.put_u16_le(self.chan14_raw);
25781 __tmp.put_u16_le(self.chan15_raw);
25782 __tmp.put_u16_le(self.chan16_raw);
25783 __tmp.put_u16_le(self.chan17_raw);
25784 __tmp.put_u16_le(self.chan18_raw);
25785 __tmp.put_u8(self.chancount);
25786 __tmp.put_u8(self.rssi);
25787 if matches!(version, MavlinkVersion::V2) {
25788 let len = __tmp.len();
25789 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25790 } else {
25791 __tmp.len()
25792 }
25793 }
25794}
25795#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
25796#[doc = ""]
25797#[doc = "ID: 70"]
25798#[derive(Debug, Clone, PartialEq)]
25799#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25800#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25801#[cfg_attr(feature = "ts", derive(TS))]
25802#[cfg_attr(feature = "ts", ts(export))]
25803pub struct RC_CHANNELS_OVERRIDE_DATA {
25804 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25805 pub chan1_raw: u16,
25806 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25807 pub chan2_raw: u16,
25808 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25809 pub chan3_raw: u16,
25810 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25811 pub chan4_raw: u16,
25812 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25813 pub chan5_raw: u16,
25814 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25815 pub chan6_raw: u16,
25816 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25817 pub chan7_raw: u16,
25818 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25819 pub chan8_raw: u16,
25820 #[doc = "System ID"]
25821 pub target_system: u8,
25822 #[doc = "Component ID"]
25823 pub target_component: u8,
25824 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25825 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25826 pub chan9_raw: u16,
25827 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25828 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25829 pub chan10_raw: u16,
25830 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25831 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25832 pub chan11_raw: u16,
25833 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25834 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25835 pub chan12_raw: u16,
25836 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25837 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25838 pub chan13_raw: u16,
25839 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25840 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25841 pub chan14_raw: u16,
25842 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25843 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25844 pub chan15_raw: u16,
25845 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25846 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25847 pub chan16_raw: u16,
25848 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25849 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25850 pub chan17_raw: u16,
25851 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25852 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25853 pub chan18_raw: u16,
25854}
25855impl RC_CHANNELS_OVERRIDE_DATA {
25856 pub const ENCODED_LEN: usize = 38usize;
25857 pub const DEFAULT: Self = Self {
25858 chan1_raw: 0_u16,
25859 chan2_raw: 0_u16,
25860 chan3_raw: 0_u16,
25861 chan4_raw: 0_u16,
25862 chan5_raw: 0_u16,
25863 chan6_raw: 0_u16,
25864 chan7_raw: 0_u16,
25865 chan8_raw: 0_u16,
25866 target_system: 0_u8,
25867 target_component: 0_u8,
25868 chan9_raw: 0_u16,
25869 chan10_raw: 0_u16,
25870 chan11_raw: 0_u16,
25871 chan12_raw: 0_u16,
25872 chan13_raw: 0_u16,
25873 chan14_raw: 0_u16,
25874 chan15_raw: 0_u16,
25875 chan16_raw: 0_u16,
25876 chan17_raw: 0_u16,
25877 chan18_raw: 0_u16,
25878 };
25879 #[cfg(feature = "arbitrary")]
25880 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25881 use arbitrary::{Arbitrary, Unstructured};
25882 let mut buf = [0u8; 1024];
25883 rng.fill_bytes(&mut buf);
25884 let mut unstructured = Unstructured::new(&buf);
25885 Self::arbitrary(&mut unstructured).unwrap_or_default()
25886 }
25887}
25888impl Default for RC_CHANNELS_OVERRIDE_DATA {
25889 fn default() -> Self {
25890 Self::DEFAULT.clone()
25891 }
25892}
25893impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
25894 type Message = MavMessage;
25895 const ID: u32 = 70u32;
25896 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
25897 const EXTRA_CRC: u8 = 124u8;
25898 const ENCODED_LEN: usize = 38usize;
25899 fn deser(
25900 _version: MavlinkVersion,
25901 __input: &[u8],
25902 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25903 let avail_len = __input.len();
25904 let mut payload_buf = [0; Self::ENCODED_LEN];
25905 let mut buf = if avail_len < Self::ENCODED_LEN {
25906 payload_buf[0..avail_len].copy_from_slice(__input);
25907 Bytes::new(&payload_buf)
25908 } else {
25909 Bytes::new(__input)
25910 };
25911 let mut __struct = Self::default();
25912 __struct.chan1_raw = buf.get_u16_le();
25913 __struct.chan2_raw = buf.get_u16_le();
25914 __struct.chan3_raw = buf.get_u16_le();
25915 __struct.chan4_raw = buf.get_u16_le();
25916 __struct.chan5_raw = buf.get_u16_le();
25917 __struct.chan6_raw = buf.get_u16_le();
25918 __struct.chan7_raw = buf.get_u16_le();
25919 __struct.chan8_raw = buf.get_u16_le();
25920 __struct.target_system = buf.get_u8();
25921 __struct.target_component = buf.get_u8();
25922 __struct.chan9_raw = buf.get_u16_le();
25923 __struct.chan10_raw = buf.get_u16_le();
25924 __struct.chan11_raw = buf.get_u16_le();
25925 __struct.chan12_raw = buf.get_u16_le();
25926 __struct.chan13_raw = buf.get_u16_le();
25927 __struct.chan14_raw = buf.get_u16_le();
25928 __struct.chan15_raw = buf.get_u16_le();
25929 __struct.chan16_raw = buf.get_u16_le();
25930 __struct.chan17_raw = buf.get_u16_le();
25931 __struct.chan18_raw = buf.get_u16_le();
25932 Ok(__struct)
25933 }
25934 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25935 let mut __tmp = BytesMut::new(bytes);
25936 #[allow(clippy::absurd_extreme_comparisons)]
25937 #[allow(unused_comparisons)]
25938 if __tmp.remaining() < Self::ENCODED_LEN {
25939 panic!(
25940 "buffer is too small (need {} bytes, but got {})",
25941 Self::ENCODED_LEN,
25942 __tmp.remaining(),
25943 )
25944 }
25945 __tmp.put_u16_le(self.chan1_raw);
25946 __tmp.put_u16_le(self.chan2_raw);
25947 __tmp.put_u16_le(self.chan3_raw);
25948 __tmp.put_u16_le(self.chan4_raw);
25949 __tmp.put_u16_le(self.chan5_raw);
25950 __tmp.put_u16_le(self.chan6_raw);
25951 __tmp.put_u16_le(self.chan7_raw);
25952 __tmp.put_u16_le(self.chan8_raw);
25953 __tmp.put_u8(self.target_system);
25954 __tmp.put_u8(self.target_component);
25955 if matches!(version, MavlinkVersion::V2) {
25956 __tmp.put_u16_le(self.chan9_raw);
25957 __tmp.put_u16_le(self.chan10_raw);
25958 __tmp.put_u16_le(self.chan11_raw);
25959 __tmp.put_u16_le(self.chan12_raw);
25960 __tmp.put_u16_le(self.chan13_raw);
25961 __tmp.put_u16_le(self.chan14_raw);
25962 __tmp.put_u16_le(self.chan15_raw);
25963 __tmp.put_u16_le(self.chan16_raw);
25964 __tmp.put_u16_le(self.chan17_raw);
25965 __tmp.put_u16_le(self.chan18_raw);
25966 let len = __tmp.len();
25967 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25968 } else {
25969 __tmp.len()
25970 }
25971 }
25972}
25973#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25974#[doc = ""]
25975#[doc = "ID: 35"]
25976#[derive(Debug, Clone, PartialEq)]
25977#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25978#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25979#[cfg_attr(feature = "ts", derive(TS))]
25980#[cfg_attr(feature = "ts", ts(export))]
25981pub struct RC_CHANNELS_RAW_DATA {
25982 #[doc = "Timestamp (time since system boot)."]
25983 pub time_boot_ms: u32,
25984 #[doc = "RC channel 1 value."]
25985 pub chan1_raw: u16,
25986 #[doc = "RC channel 2 value."]
25987 pub chan2_raw: u16,
25988 #[doc = "RC channel 3 value."]
25989 pub chan3_raw: u16,
25990 #[doc = "RC channel 4 value."]
25991 pub chan4_raw: u16,
25992 #[doc = "RC channel 5 value."]
25993 pub chan5_raw: u16,
25994 #[doc = "RC channel 6 value."]
25995 pub chan6_raw: u16,
25996 #[doc = "RC channel 7 value."]
25997 pub chan7_raw: u16,
25998 #[doc = "RC channel 8 value."]
25999 pub chan8_raw: u16,
26000 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26001 pub port: u8,
26002 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26003 pub rssi: u8,
26004}
26005impl RC_CHANNELS_RAW_DATA {
26006 pub const ENCODED_LEN: usize = 22usize;
26007 pub const DEFAULT: Self = Self {
26008 time_boot_ms: 0_u32,
26009 chan1_raw: 0_u16,
26010 chan2_raw: 0_u16,
26011 chan3_raw: 0_u16,
26012 chan4_raw: 0_u16,
26013 chan5_raw: 0_u16,
26014 chan6_raw: 0_u16,
26015 chan7_raw: 0_u16,
26016 chan8_raw: 0_u16,
26017 port: 0_u8,
26018 rssi: 0_u8,
26019 };
26020 #[cfg(feature = "arbitrary")]
26021 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26022 use arbitrary::{Arbitrary, Unstructured};
26023 let mut buf = [0u8; 1024];
26024 rng.fill_bytes(&mut buf);
26025 let mut unstructured = Unstructured::new(&buf);
26026 Self::arbitrary(&mut unstructured).unwrap_or_default()
26027 }
26028}
26029impl Default for RC_CHANNELS_RAW_DATA {
26030 fn default() -> Self {
26031 Self::DEFAULT.clone()
26032 }
26033}
26034impl MessageData for RC_CHANNELS_RAW_DATA {
26035 type Message = MavMessage;
26036 const ID: u32 = 35u32;
26037 const NAME: &'static str = "RC_CHANNELS_RAW";
26038 const EXTRA_CRC: u8 = 244u8;
26039 const ENCODED_LEN: usize = 22usize;
26040 fn deser(
26041 _version: MavlinkVersion,
26042 __input: &[u8],
26043 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26044 let avail_len = __input.len();
26045 let mut payload_buf = [0; Self::ENCODED_LEN];
26046 let mut buf = if avail_len < Self::ENCODED_LEN {
26047 payload_buf[0..avail_len].copy_from_slice(__input);
26048 Bytes::new(&payload_buf)
26049 } else {
26050 Bytes::new(__input)
26051 };
26052 let mut __struct = Self::default();
26053 __struct.time_boot_ms = buf.get_u32_le();
26054 __struct.chan1_raw = buf.get_u16_le();
26055 __struct.chan2_raw = buf.get_u16_le();
26056 __struct.chan3_raw = buf.get_u16_le();
26057 __struct.chan4_raw = buf.get_u16_le();
26058 __struct.chan5_raw = buf.get_u16_le();
26059 __struct.chan6_raw = buf.get_u16_le();
26060 __struct.chan7_raw = buf.get_u16_le();
26061 __struct.chan8_raw = buf.get_u16_le();
26062 __struct.port = buf.get_u8();
26063 __struct.rssi = buf.get_u8();
26064 Ok(__struct)
26065 }
26066 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26067 let mut __tmp = BytesMut::new(bytes);
26068 #[allow(clippy::absurd_extreme_comparisons)]
26069 #[allow(unused_comparisons)]
26070 if __tmp.remaining() < Self::ENCODED_LEN {
26071 panic!(
26072 "buffer is too small (need {} bytes, but got {})",
26073 Self::ENCODED_LEN,
26074 __tmp.remaining(),
26075 )
26076 }
26077 __tmp.put_u32_le(self.time_boot_ms);
26078 __tmp.put_u16_le(self.chan1_raw);
26079 __tmp.put_u16_le(self.chan2_raw);
26080 __tmp.put_u16_le(self.chan3_raw);
26081 __tmp.put_u16_le(self.chan4_raw);
26082 __tmp.put_u16_le(self.chan5_raw);
26083 __tmp.put_u16_le(self.chan6_raw);
26084 __tmp.put_u16_le(self.chan7_raw);
26085 __tmp.put_u16_le(self.chan8_raw);
26086 __tmp.put_u8(self.port);
26087 __tmp.put_u8(self.rssi);
26088 if matches!(version, MavlinkVersion::V2) {
26089 let len = __tmp.len();
26090 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26091 } else {
26092 __tmp.len()
26093 }
26094 }
26095}
26096#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
26097#[doc = ""]
26098#[doc = "ID: 34"]
26099#[derive(Debug, Clone, PartialEq)]
26100#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26101#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26102#[cfg_attr(feature = "ts", derive(TS))]
26103#[cfg_attr(feature = "ts", ts(export))]
26104pub struct RC_CHANNELS_SCALED_DATA {
26105 #[doc = "Timestamp (time since system boot)."]
26106 pub time_boot_ms: u32,
26107 #[doc = "RC channel 1 value scaled."]
26108 pub chan1_scaled: i16,
26109 #[doc = "RC channel 2 value scaled."]
26110 pub chan2_scaled: i16,
26111 #[doc = "RC channel 3 value scaled."]
26112 pub chan3_scaled: i16,
26113 #[doc = "RC channel 4 value scaled."]
26114 pub chan4_scaled: i16,
26115 #[doc = "RC channel 5 value scaled."]
26116 pub chan5_scaled: i16,
26117 #[doc = "RC channel 6 value scaled."]
26118 pub chan6_scaled: i16,
26119 #[doc = "RC channel 7 value scaled."]
26120 pub chan7_scaled: i16,
26121 #[doc = "RC channel 8 value scaled."]
26122 pub chan8_scaled: i16,
26123 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26124 pub port: u8,
26125 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26126 pub rssi: u8,
26127}
26128impl RC_CHANNELS_SCALED_DATA {
26129 pub const ENCODED_LEN: usize = 22usize;
26130 pub const DEFAULT: Self = Self {
26131 time_boot_ms: 0_u32,
26132 chan1_scaled: 0_i16,
26133 chan2_scaled: 0_i16,
26134 chan3_scaled: 0_i16,
26135 chan4_scaled: 0_i16,
26136 chan5_scaled: 0_i16,
26137 chan6_scaled: 0_i16,
26138 chan7_scaled: 0_i16,
26139 chan8_scaled: 0_i16,
26140 port: 0_u8,
26141 rssi: 0_u8,
26142 };
26143 #[cfg(feature = "arbitrary")]
26144 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26145 use arbitrary::{Arbitrary, Unstructured};
26146 let mut buf = [0u8; 1024];
26147 rng.fill_bytes(&mut buf);
26148 let mut unstructured = Unstructured::new(&buf);
26149 Self::arbitrary(&mut unstructured).unwrap_or_default()
26150 }
26151}
26152impl Default for RC_CHANNELS_SCALED_DATA {
26153 fn default() -> Self {
26154 Self::DEFAULT.clone()
26155 }
26156}
26157impl MessageData for RC_CHANNELS_SCALED_DATA {
26158 type Message = MavMessage;
26159 const ID: u32 = 34u32;
26160 const NAME: &'static str = "RC_CHANNELS_SCALED";
26161 const EXTRA_CRC: u8 = 237u8;
26162 const ENCODED_LEN: usize = 22usize;
26163 fn deser(
26164 _version: MavlinkVersion,
26165 __input: &[u8],
26166 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26167 let avail_len = __input.len();
26168 let mut payload_buf = [0; Self::ENCODED_LEN];
26169 let mut buf = if avail_len < Self::ENCODED_LEN {
26170 payload_buf[0..avail_len].copy_from_slice(__input);
26171 Bytes::new(&payload_buf)
26172 } else {
26173 Bytes::new(__input)
26174 };
26175 let mut __struct = Self::default();
26176 __struct.time_boot_ms = buf.get_u32_le();
26177 __struct.chan1_scaled = buf.get_i16_le();
26178 __struct.chan2_scaled = buf.get_i16_le();
26179 __struct.chan3_scaled = buf.get_i16_le();
26180 __struct.chan4_scaled = buf.get_i16_le();
26181 __struct.chan5_scaled = buf.get_i16_le();
26182 __struct.chan6_scaled = buf.get_i16_le();
26183 __struct.chan7_scaled = buf.get_i16_le();
26184 __struct.chan8_scaled = buf.get_i16_le();
26185 __struct.port = buf.get_u8();
26186 __struct.rssi = buf.get_u8();
26187 Ok(__struct)
26188 }
26189 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26190 let mut __tmp = BytesMut::new(bytes);
26191 #[allow(clippy::absurd_extreme_comparisons)]
26192 #[allow(unused_comparisons)]
26193 if __tmp.remaining() < Self::ENCODED_LEN {
26194 panic!(
26195 "buffer is too small (need {} bytes, but got {})",
26196 Self::ENCODED_LEN,
26197 __tmp.remaining(),
26198 )
26199 }
26200 __tmp.put_u32_le(self.time_boot_ms);
26201 __tmp.put_i16_le(self.chan1_scaled);
26202 __tmp.put_i16_le(self.chan2_scaled);
26203 __tmp.put_i16_le(self.chan3_scaled);
26204 __tmp.put_i16_le(self.chan4_scaled);
26205 __tmp.put_i16_le(self.chan5_scaled);
26206 __tmp.put_i16_le(self.chan6_scaled);
26207 __tmp.put_i16_le(self.chan7_scaled);
26208 __tmp.put_i16_le(self.chan8_scaled);
26209 __tmp.put_u8(self.port);
26210 __tmp.put_u8(self.rssi);
26211 if matches!(version, MavlinkVersion::V2) {
26212 let len = __tmp.len();
26213 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26214 } else {
26215 __tmp.len()
26216 }
26217 }
26218}
26219#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
26220#[doc = "Request a data stream."]
26221#[doc = ""]
26222#[doc = "ID: 66"]
26223#[derive(Debug, Clone, PartialEq)]
26224#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26225#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26226#[cfg_attr(feature = "ts", derive(TS))]
26227#[cfg_attr(feature = "ts", ts(export))]
26228pub struct REQUEST_DATA_STREAM_DATA {
26229 #[doc = "The requested message rate"]
26230 pub req_message_rate: u16,
26231 #[doc = "The target requested to send the message stream."]
26232 pub target_system: u8,
26233 #[doc = "The target requested to send the message stream."]
26234 pub target_component: u8,
26235 #[doc = "The ID of the requested data stream"]
26236 pub req_stream_id: u8,
26237 #[doc = "1 to start sending, 0 to stop sending."]
26238 pub start_stop: u8,
26239}
26240impl REQUEST_DATA_STREAM_DATA {
26241 pub const ENCODED_LEN: usize = 6usize;
26242 pub const DEFAULT: Self = Self {
26243 req_message_rate: 0_u16,
26244 target_system: 0_u8,
26245 target_component: 0_u8,
26246 req_stream_id: 0_u8,
26247 start_stop: 0_u8,
26248 };
26249 #[cfg(feature = "arbitrary")]
26250 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26251 use arbitrary::{Arbitrary, Unstructured};
26252 let mut buf = [0u8; 1024];
26253 rng.fill_bytes(&mut buf);
26254 let mut unstructured = Unstructured::new(&buf);
26255 Self::arbitrary(&mut unstructured).unwrap_or_default()
26256 }
26257}
26258impl Default for REQUEST_DATA_STREAM_DATA {
26259 fn default() -> Self {
26260 Self::DEFAULT.clone()
26261 }
26262}
26263impl MessageData for REQUEST_DATA_STREAM_DATA {
26264 type Message = MavMessage;
26265 const ID: u32 = 66u32;
26266 const NAME: &'static str = "REQUEST_DATA_STREAM";
26267 const EXTRA_CRC: u8 = 148u8;
26268 const ENCODED_LEN: usize = 6usize;
26269 fn deser(
26270 _version: MavlinkVersion,
26271 __input: &[u8],
26272 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26273 let avail_len = __input.len();
26274 let mut payload_buf = [0; Self::ENCODED_LEN];
26275 let mut buf = if avail_len < Self::ENCODED_LEN {
26276 payload_buf[0..avail_len].copy_from_slice(__input);
26277 Bytes::new(&payload_buf)
26278 } else {
26279 Bytes::new(__input)
26280 };
26281 let mut __struct = Self::default();
26282 __struct.req_message_rate = buf.get_u16_le();
26283 __struct.target_system = buf.get_u8();
26284 __struct.target_component = buf.get_u8();
26285 __struct.req_stream_id = buf.get_u8();
26286 __struct.start_stop = buf.get_u8();
26287 Ok(__struct)
26288 }
26289 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26290 let mut __tmp = BytesMut::new(bytes);
26291 #[allow(clippy::absurd_extreme_comparisons)]
26292 #[allow(unused_comparisons)]
26293 if __tmp.remaining() < Self::ENCODED_LEN {
26294 panic!(
26295 "buffer is too small (need {} bytes, but got {})",
26296 Self::ENCODED_LEN,
26297 __tmp.remaining(),
26298 )
26299 }
26300 __tmp.put_u16_le(self.req_message_rate);
26301 __tmp.put_u8(self.target_system);
26302 __tmp.put_u8(self.target_component);
26303 __tmp.put_u8(self.req_stream_id);
26304 __tmp.put_u8(self.start_stop);
26305 if matches!(version, MavlinkVersion::V2) {
26306 let len = __tmp.len();
26307 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26308 } else {
26309 __tmp.len()
26310 }
26311 }
26312}
26313#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
26314#[doc = ""]
26315#[doc = "ID: 412"]
26316#[derive(Debug, Clone, PartialEq)]
26317#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26318#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26319#[cfg_attr(feature = "ts", derive(TS))]
26320#[cfg_attr(feature = "ts", ts(export))]
26321pub struct REQUEST_EVENT_DATA {
26322 #[doc = "First sequence number of the requested event."]
26323 pub first_sequence: u16,
26324 #[doc = "Last sequence number of the requested event."]
26325 pub last_sequence: u16,
26326 #[doc = "System ID"]
26327 pub target_system: u8,
26328 #[doc = "Component ID"]
26329 pub target_component: u8,
26330}
26331impl REQUEST_EVENT_DATA {
26332 pub const ENCODED_LEN: usize = 6usize;
26333 pub const DEFAULT: Self = Self {
26334 first_sequence: 0_u16,
26335 last_sequence: 0_u16,
26336 target_system: 0_u8,
26337 target_component: 0_u8,
26338 };
26339 #[cfg(feature = "arbitrary")]
26340 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26341 use arbitrary::{Arbitrary, Unstructured};
26342 let mut buf = [0u8; 1024];
26343 rng.fill_bytes(&mut buf);
26344 let mut unstructured = Unstructured::new(&buf);
26345 Self::arbitrary(&mut unstructured).unwrap_or_default()
26346 }
26347}
26348impl Default for REQUEST_EVENT_DATA {
26349 fn default() -> Self {
26350 Self::DEFAULT.clone()
26351 }
26352}
26353impl MessageData for REQUEST_EVENT_DATA {
26354 type Message = MavMessage;
26355 const ID: u32 = 412u32;
26356 const NAME: &'static str = "REQUEST_EVENT";
26357 const EXTRA_CRC: u8 = 33u8;
26358 const ENCODED_LEN: usize = 6usize;
26359 fn deser(
26360 _version: MavlinkVersion,
26361 __input: &[u8],
26362 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26363 let avail_len = __input.len();
26364 let mut payload_buf = [0; Self::ENCODED_LEN];
26365 let mut buf = if avail_len < Self::ENCODED_LEN {
26366 payload_buf[0..avail_len].copy_from_slice(__input);
26367 Bytes::new(&payload_buf)
26368 } else {
26369 Bytes::new(__input)
26370 };
26371 let mut __struct = Self::default();
26372 __struct.first_sequence = buf.get_u16_le();
26373 __struct.last_sequence = buf.get_u16_le();
26374 __struct.target_system = buf.get_u8();
26375 __struct.target_component = buf.get_u8();
26376 Ok(__struct)
26377 }
26378 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26379 let mut __tmp = BytesMut::new(bytes);
26380 #[allow(clippy::absurd_extreme_comparisons)]
26381 #[allow(unused_comparisons)]
26382 if __tmp.remaining() < Self::ENCODED_LEN {
26383 panic!(
26384 "buffer is too small (need {} bytes, but got {})",
26385 Self::ENCODED_LEN,
26386 __tmp.remaining(),
26387 )
26388 }
26389 __tmp.put_u16_le(self.first_sequence);
26390 __tmp.put_u16_le(self.last_sequence);
26391 __tmp.put_u8(self.target_system);
26392 __tmp.put_u8(self.target_component);
26393 if matches!(version, MavlinkVersion::V2) {
26394 let len = __tmp.len();
26395 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26396 } else {
26397 __tmp.len()
26398 }
26399 }
26400}
26401#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
26402#[doc = ""]
26403#[doc = "ID: 142"]
26404#[derive(Debug, Clone, PartialEq)]
26405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26406#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26407#[cfg_attr(feature = "ts", derive(TS))]
26408#[cfg_attr(feature = "ts", ts(export))]
26409pub struct RESOURCE_REQUEST_DATA {
26410 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
26411 pub request_id: u8,
26412 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
26413 pub uri_type: u8,
26414 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
26415 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26416 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26417 pub uri: [u8; 120],
26418 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
26419 pub transfer_type: u8,
26420 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
26421 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26422 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26423 pub storage: [u8; 120],
26424}
26425impl RESOURCE_REQUEST_DATA {
26426 pub const ENCODED_LEN: usize = 243usize;
26427 pub const DEFAULT: Self = Self {
26428 request_id: 0_u8,
26429 uri_type: 0_u8,
26430 uri: [0_u8; 120usize],
26431 transfer_type: 0_u8,
26432 storage: [0_u8; 120usize],
26433 };
26434 #[cfg(feature = "arbitrary")]
26435 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26436 use arbitrary::{Arbitrary, Unstructured};
26437 let mut buf = [0u8; 1024];
26438 rng.fill_bytes(&mut buf);
26439 let mut unstructured = Unstructured::new(&buf);
26440 Self::arbitrary(&mut unstructured).unwrap_or_default()
26441 }
26442}
26443impl Default for RESOURCE_REQUEST_DATA {
26444 fn default() -> Self {
26445 Self::DEFAULT.clone()
26446 }
26447}
26448impl MessageData for RESOURCE_REQUEST_DATA {
26449 type Message = MavMessage;
26450 const ID: u32 = 142u32;
26451 const NAME: &'static str = "RESOURCE_REQUEST";
26452 const EXTRA_CRC: u8 = 72u8;
26453 const ENCODED_LEN: usize = 243usize;
26454 fn deser(
26455 _version: MavlinkVersion,
26456 __input: &[u8],
26457 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26458 let avail_len = __input.len();
26459 let mut payload_buf = [0; Self::ENCODED_LEN];
26460 let mut buf = if avail_len < Self::ENCODED_LEN {
26461 payload_buf[0..avail_len].copy_from_slice(__input);
26462 Bytes::new(&payload_buf)
26463 } else {
26464 Bytes::new(__input)
26465 };
26466 let mut __struct = Self::default();
26467 __struct.request_id = buf.get_u8();
26468 __struct.uri_type = buf.get_u8();
26469 for v in &mut __struct.uri {
26470 let val = buf.get_u8();
26471 *v = val;
26472 }
26473 __struct.transfer_type = buf.get_u8();
26474 for v in &mut __struct.storage {
26475 let val = buf.get_u8();
26476 *v = val;
26477 }
26478 Ok(__struct)
26479 }
26480 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26481 let mut __tmp = BytesMut::new(bytes);
26482 #[allow(clippy::absurd_extreme_comparisons)]
26483 #[allow(unused_comparisons)]
26484 if __tmp.remaining() < Self::ENCODED_LEN {
26485 panic!(
26486 "buffer is too small (need {} bytes, but got {})",
26487 Self::ENCODED_LEN,
26488 __tmp.remaining(),
26489 )
26490 }
26491 __tmp.put_u8(self.request_id);
26492 __tmp.put_u8(self.uri_type);
26493 for val in &self.uri {
26494 __tmp.put_u8(*val);
26495 }
26496 __tmp.put_u8(self.transfer_type);
26497 for val in &self.storage {
26498 __tmp.put_u8(*val);
26499 }
26500 if matches!(version, MavlinkVersion::V2) {
26501 let len = __tmp.len();
26502 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26503 } else {
26504 __tmp.len()
26505 }
26506 }
26507}
26508#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
26509#[doc = ""]
26510#[doc = "ID: 413"]
26511#[derive(Debug, Clone, PartialEq)]
26512#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26513#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26514#[cfg_attr(feature = "ts", derive(TS))]
26515#[cfg_attr(feature = "ts", ts(export))]
26516pub struct RESPONSE_EVENT_ERROR_DATA {
26517 #[doc = "Sequence number."]
26518 pub sequence: u16,
26519 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
26520 pub sequence_oldest_available: u16,
26521 #[doc = "System ID"]
26522 pub target_system: u8,
26523 #[doc = "Component ID"]
26524 pub target_component: u8,
26525 #[doc = "Error reason."]
26526 pub reason: MavEventErrorReason,
26527}
26528impl RESPONSE_EVENT_ERROR_DATA {
26529 pub const ENCODED_LEN: usize = 7usize;
26530 pub const DEFAULT: Self = Self {
26531 sequence: 0_u16,
26532 sequence_oldest_available: 0_u16,
26533 target_system: 0_u8,
26534 target_component: 0_u8,
26535 reason: MavEventErrorReason::DEFAULT,
26536 };
26537 #[cfg(feature = "arbitrary")]
26538 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26539 use arbitrary::{Arbitrary, Unstructured};
26540 let mut buf = [0u8; 1024];
26541 rng.fill_bytes(&mut buf);
26542 let mut unstructured = Unstructured::new(&buf);
26543 Self::arbitrary(&mut unstructured).unwrap_or_default()
26544 }
26545}
26546impl Default for RESPONSE_EVENT_ERROR_DATA {
26547 fn default() -> Self {
26548 Self::DEFAULT.clone()
26549 }
26550}
26551impl MessageData for RESPONSE_EVENT_ERROR_DATA {
26552 type Message = MavMessage;
26553 const ID: u32 = 413u32;
26554 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
26555 const EXTRA_CRC: u8 = 77u8;
26556 const ENCODED_LEN: usize = 7usize;
26557 fn deser(
26558 _version: MavlinkVersion,
26559 __input: &[u8],
26560 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26561 let avail_len = __input.len();
26562 let mut payload_buf = [0; Self::ENCODED_LEN];
26563 let mut buf = if avail_len < Self::ENCODED_LEN {
26564 payload_buf[0..avail_len].copy_from_slice(__input);
26565 Bytes::new(&payload_buf)
26566 } else {
26567 Bytes::new(__input)
26568 };
26569 let mut __struct = Self::default();
26570 __struct.sequence = buf.get_u16_le();
26571 __struct.sequence_oldest_available = buf.get_u16_le();
26572 __struct.target_system = buf.get_u8();
26573 __struct.target_component = buf.get_u8();
26574 let tmp = buf.get_u8();
26575 __struct.reason =
26576 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26577 enum_type: "MavEventErrorReason",
26578 value: tmp as u64,
26579 })?;
26580 Ok(__struct)
26581 }
26582 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26583 let mut __tmp = BytesMut::new(bytes);
26584 #[allow(clippy::absurd_extreme_comparisons)]
26585 #[allow(unused_comparisons)]
26586 if __tmp.remaining() < Self::ENCODED_LEN {
26587 panic!(
26588 "buffer is too small (need {} bytes, but got {})",
26589 Self::ENCODED_LEN,
26590 __tmp.remaining(),
26591 )
26592 }
26593 __tmp.put_u16_le(self.sequence);
26594 __tmp.put_u16_le(self.sequence_oldest_available);
26595 __tmp.put_u8(self.target_system);
26596 __tmp.put_u8(self.target_component);
26597 __tmp.put_u8(self.reason as u8);
26598 if matches!(version, MavlinkVersion::V2) {
26599 let len = __tmp.len();
26600 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26601 } else {
26602 __tmp.len()
26603 }
26604 }
26605}
26606#[doc = "Read out the safety zone the MAV currently assumes."]
26607#[doc = ""]
26608#[doc = "ID: 55"]
26609#[derive(Debug, Clone, PartialEq)]
26610#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26611#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26612#[cfg_attr(feature = "ts", derive(TS))]
26613#[cfg_attr(feature = "ts", ts(export))]
26614pub struct SAFETY_ALLOWED_AREA_DATA {
26615 #[doc = "x position 1 / Latitude 1"]
26616 pub p1x: f32,
26617 #[doc = "y position 1 / Longitude 1"]
26618 pub p1y: f32,
26619 #[doc = "z position 1 / Altitude 1"]
26620 pub p1z: f32,
26621 #[doc = "x position 2 / Latitude 2"]
26622 pub p2x: f32,
26623 #[doc = "y position 2 / Longitude 2"]
26624 pub p2y: f32,
26625 #[doc = "z position 2 / Altitude 2"]
26626 pub p2z: f32,
26627 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26628 pub frame: MavFrame,
26629}
26630impl SAFETY_ALLOWED_AREA_DATA {
26631 pub const ENCODED_LEN: usize = 25usize;
26632 pub const DEFAULT: Self = Self {
26633 p1x: 0.0_f32,
26634 p1y: 0.0_f32,
26635 p1z: 0.0_f32,
26636 p2x: 0.0_f32,
26637 p2y: 0.0_f32,
26638 p2z: 0.0_f32,
26639 frame: MavFrame::DEFAULT,
26640 };
26641 #[cfg(feature = "arbitrary")]
26642 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26643 use arbitrary::{Arbitrary, Unstructured};
26644 let mut buf = [0u8; 1024];
26645 rng.fill_bytes(&mut buf);
26646 let mut unstructured = Unstructured::new(&buf);
26647 Self::arbitrary(&mut unstructured).unwrap_or_default()
26648 }
26649}
26650impl Default for SAFETY_ALLOWED_AREA_DATA {
26651 fn default() -> Self {
26652 Self::DEFAULT.clone()
26653 }
26654}
26655impl MessageData for SAFETY_ALLOWED_AREA_DATA {
26656 type Message = MavMessage;
26657 const ID: u32 = 55u32;
26658 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
26659 const EXTRA_CRC: u8 = 3u8;
26660 const ENCODED_LEN: usize = 25usize;
26661 fn deser(
26662 _version: MavlinkVersion,
26663 __input: &[u8],
26664 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26665 let avail_len = __input.len();
26666 let mut payload_buf = [0; Self::ENCODED_LEN];
26667 let mut buf = if avail_len < Self::ENCODED_LEN {
26668 payload_buf[0..avail_len].copy_from_slice(__input);
26669 Bytes::new(&payload_buf)
26670 } else {
26671 Bytes::new(__input)
26672 };
26673 let mut __struct = Self::default();
26674 __struct.p1x = buf.get_f32_le();
26675 __struct.p1y = buf.get_f32_le();
26676 __struct.p1z = buf.get_f32_le();
26677 __struct.p2x = buf.get_f32_le();
26678 __struct.p2y = buf.get_f32_le();
26679 __struct.p2z = buf.get_f32_le();
26680 let tmp = buf.get_u8();
26681 __struct.frame =
26682 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26683 enum_type: "MavFrame",
26684 value: tmp as u64,
26685 })?;
26686 Ok(__struct)
26687 }
26688 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26689 let mut __tmp = BytesMut::new(bytes);
26690 #[allow(clippy::absurd_extreme_comparisons)]
26691 #[allow(unused_comparisons)]
26692 if __tmp.remaining() < Self::ENCODED_LEN {
26693 panic!(
26694 "buffer is too small (need {} bytes, but got {})",
26695 Self::ENCODED_LEN,
26696 __tmp.remaining(),
26697 )
26698 }
26699 __tmp.put_f32_le(self.p1x);
26700 __tmp.put_f32_le(self.p1y);
26701 __tmp.put_f32_le(self.p1z);
26702 __tmp.put_f32_le(self.p2x);
26703 __tmp.put_f32_le(self.p2y);
26704 __tmp.put_f32_le(self.p2z);
26705 __tmp.put_u8(self.frame as u8);
26706 if matches!(version, MavlinkVersion::V2) {
26707 let len = __tmp.len();
26708 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26709 } else {
26710 __tmp.len()
26711 }
26712 }
26713}
26714#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
26715#[doc = ""]
26716#[doc = "ID: 54"]
26717#[derive(Debug, Clone, PartialEq)]
26718#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26719#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26720#[cfg_attr(feature = "ts", derive(TS))]
26721#[cfg_attr(feature = "ts", ts(export))]
26722pub struct SAFETY_SET_ALLOWED_AREA_DATA {
26723 #[doc = "x position 1 / Latitude 1"]
26724 pub p1x: f32,
26725 #[doc = "y position 1 / Longitude 1"]
26726 pub p1y: f32,
26727 #[doc = "z position 1 / Altitude 1"]
26728 pub p1z: f32,
26729 #[doc = "x position 2 / Latitude 2"]
26730 pub p2x: f32,
26731 #[doc = "y position 2 / Longitude 2"]
26732 pub p2y: f32,
26733 #[doc = "z position 2 / Altitude 2"]
26734 pub p2z: f32,
26735 #[doc = "System ID"]
26736 pub target_system: u8,
26737 #[doc = "Component ID"]
26738 pub target_component: u8,
26739 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26740 pub frame: MavFrame,
26741}
26742impl SAFETY_SET_ALLOWED_AREA_DATA {
26743 pub const ENCODED_LEN: usize = 27usize;
26744 pub const DEFAULT: Self = Self {
26745 p1x: 0.0_f32,
26746 p1y: 0.0_f32,
26747 p1z: 0.0_f32,
26748 p2x: 0.0_f32,
26749 p2y: 0.0_f32,
26750 p2z: 0.0_f32,
26751 target_system: 0_u8,
26752 target_component: 0_u8,
26753 frame: MavFrame::DEFAULT,
26754 };
26755 #[cfg(feature = "arbitrary")]
26756 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26757 use arbitrary::{Arbitrary, Unstructured};
26758 let mut buf = [0u8; 1024];
26759 rng.fill_bytes(&mut buf);
26760 let mut unstructured = Unstructured::new(&buf);
26761 Self::arbitrary(&mut unstructured).unwrap_or_default()
26762 }
26763}
26764impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
26765 fn default() -> Self {
26766 Self::DEFAULT.clone()
26767 }
26768}
26769impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
26770 type Message = MavMessage;
26771 const ID: u32 = 54u32;
26772 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
26773 const EXTRA_CRC: u8 = 15u8;
26774 const ENCODED_LEN: usize = 27usize;
26775 fn deser(
26776 _version: MavlinkVersion,
26777 __input: &[u8],
26778 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26779 let avail_len = __input.len();
26780 let mut payload_buf = [0; Self::ENCODED_LEN];
26781 let mut buf = if avail_len < Self::ENCODED_LEN {
26782 payload_buf[0..avail_len].copy_from_slice(__input);
26783 Bytes::new(&payload_buf)
26784 } else {
26785 Bytes::new(__input)
26786 };
26787 let mut __struct = Self::default();
26788 __struct.p1x = buf.get_f32_le();
26789 __struct.p1y = buf.get_f32_le();
26790 __struct.p1z = buf.get_f32_le();
26791 __struct.p2x = buf.get_f32_le();
26792 __struct.p2y = buf.get_f32_le();
26793 __struct.p2z = buf.get_f32_le();
26794 __struct.target_system = buf.get_u8();
26795 __struct.target_component = buf.get_u8();
26796 let tmp = buf.get_u8();
26797 __struct.frame =
26798 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26799 enum_type: "MavFrame",
26800 value: tmp as u64,
26801 })?;
26802 Ok(__struct)
26803 }
26804 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26805 let mut __tmp = BytesMut::new(bytes);
26806 #[allow(clippy::absurd_extreme_comparisons)]
26807 #[allow(unused_comparisons)]
26808 if __tmp.remaining() < Self::ENCODED_LEN {
26809 panic!(
26810 "buffer is too small (need {} bytes, but got {})",
26811 Self::ENCODED_LEN,
26812 __tmp.remaining(),
26813 )
26814 }
26815 __tmp.put_f32_le(self.p1x);
26816 __tmp.put_f32_le(self.p1y);
26817 __tmp.put_f32_le(self.p1z);
26818 __tmp.put_f32_le(self.p2x);
26819 __tmp.put_f32_le(self.p2y);
26820 __tmp.put_f32_le(self.p2z);
26821 __tmp.put_u8(self.target_system);
26822 __tmp.put_u8(self.target_component);
26823 __tmp.put_u8(self.frame as u8);
26824 if matches!(version, MavlinkVersion::V2) {
26825 let len = __tmp.len();
26826 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26827 } else {
26828 __tmp.len()
26829 }
26830 }
26831}
26832#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
26833#[doc = ""]
26834#[doc = "ID: 26"]
26835#[derive(Debug, Clone, PartialEq)]
26836#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26837#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26838#[cfg_attr(feature = "ts", derive(TS))]
26839#[cfg_attr(feature = "ts", ts(export))]
26840pub struct SCALED_IMU_DATA {
26841 #[doc = "Timestamp (time since system boot)."]
26842 pub time_boot_ms: u32,
26843 #[doc = "X acceleration"]
26844 pub xacc: i16,
26845 #[doc = "Y acceleration"]
26846 pub yacc: i16,
26847 #[doc = "Z acceleration"]
26848 pub zacc: i16,
26849 #[doc = "Angular speed around X axis"]
26850 pub xgyro: i16,
26851 #[doc = "Angular speed around Y axis"]
26852 pub ygyro: i16,
26853 #[doc = "Angular speed around Z axis"]
26854 pub zgyro: i16,
26855 #[doc = "X Magnetic field"]
26856 pub xmag: i16,
26857 #[doc = "Y Magnetic field"]
26858 pub ymag: i16,
26859 #[doc = "Z Magnetic field"]
26860 pub zmag: i16,
26861 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26862 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26863 pub temperature: i16,
26864}
26865impl SCALED_IMU_DATA {
26866 pub const ENCODED_LEN: usize = 24usize;
26867 pub const DEFAULT: Self = Self {
26868 time_boot_ms: 0_u32,
26869 xacc: 0_i16,
26870 yacc: 0_i16,
26871 zacc: 0_i16,
26872 xgyro: 0_i16,
26873 ygyro: 0_i16,
26874 zgyro: 0_i16,
26875 xmag: 0_i16,
26876 ymag: 0_i16,
26877 zmag: 0_i16,
26878 temperature: 0_i16,
26879 };
26880 #[cfg(feature = "arbitrary")]
26881 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26882 use arbitrary::{Arbitrary, Unstructured};
26883 let mut buf = [0u8; 1024];
26884 rng.fill_bytes(&mut buf);
26885 let mut unstructured = Unstructured::new(&buf);
26886 Self::arbitrary(&mut unstructured).unwrap_or_default()
26887 }
26888}
26889impl Default for SCALED_IMU_DATA {
26890 fn default() -> Self {
26891 Self::DEFAULT.clone()
26892 }
26893}
26894impl MessageData for SCALED_IMU_DATA {
26895 type Message = MavMessage;
26896 const ID: u32 = 26u32;
26897 const NAME: &'static str = "SCALED_IMU";
26898 const EXTRA_CRC: u8 = 170u8;
26899 const ENCODED_LEN: usize = 24usize;
26900 fn deser(
26901 _version: MavlinkVersion,
26902 __input: &[u8],
26903 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26904 let avail_len = __input.len();
26905 let mut payload_buf = [0; Self::ENCODED_LEN];
26906 let mut buf = if avail_len < Self::ENCODED_LEN {
26907 payload_buf[0..avail_len].copy_from_slice(__input);
26908 Bytes::new(&payload_buf)
26909 } else {
26910 Bytes::new(__input)
26911 };
26912 let mut __struct = Self::default();
26913 __struct.time_boot_ms = buf.get_u32_le();
26914 __struct.xacc = buf.get_i16_le();
26915 __struct.yacc = buf.get_i16_le();
26916 __struct.zacc = buf.get_i16_le();
26917 __struct.xgyro = buf.get_i16_le();
26918 __struct.ygyro = buf.get_i16_le();
26919 __struct.zgyro = buf.get_i16_le();
26920 __struct.xmag = buf.get_i16_le();
26921 __struct.ymag = buf.get_i16_le();
26922 __struct.zmag = buf.get_i16_le();
26923 __struct.temperature = buf.get_i16_le();
26924 Ok(__struct)
26925 }
26926 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26927 let mut __tmp = BytesMut::new(bytes);
26928 #[allow(clippy::absurd_extreme_comparisons)]
26929 #[allow(unused_comparisons)]
26930 if __tmp.remaining() < Self::ENCODED_LEN {
26931 panic!(
26932 "buffer is too small (need {} bytes, but got {})",
26933 Self::ENCODED_LEN,
26934 __tmp.remaining(),
26935 )
26936 }
26937 __tmp.put_u32_le(self.time_boot_ms);
26938 __tmp.put_i16_le(self.xacc);
26939 __tmp.put_i16_le(self.yacc);
26940 __tmp.put_i16_le(self.zacc);
26941 __tmp.put_i16_le(self.xgyro);
26942 __tmp.put_i16_le(self.ygyro);
26943 __tmp.put_i16_le(self.zgyro);
26944 __tmp.put_i16_le(self.xmag);
26945 __tmp.put_i16_le(self.ymag);
26946 __tmp.put_i16_le(self.zmag);
26947 if matches!(version, MavlinkVersion::V2) {
26948 __tmp.put_i16_le(self.temperature);
26949 let len = __tmp.len();
26950 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26951 } else {
26952 __tmp.len()
26953 }
26954 }
26955}
26956#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
26957#[doc = ""]
26958#[doc = "ID: 116"]
26959#[derive(Debug, Clone, PartialEq)]
26960#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26961#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26962#[cfg_attr(feature = "ts", derive(TS))]
26963#[cfg_attr(feature = "ts", ts(export))]
26964pub struct SCALED_IMU2_DATA {
26965 #[doc = "Timestamp (time since system boot)."]
26966 pub time_boot_ms: u32,
26967 #[doc = "X acceleration"]
26968 pub xacc: i16,
26969 #[doc = "Y acceleration"]
26970 pub yacc: i16,
26971 #[doc = "Z acceleration"]
26972 pub zacc: i16,
26973 #[doc = "Angular speed around X axis"]
26974 pub xgyro: i16,
26975 #[doc = "Angular speed around Y axis"]
26976 pub ygyro: i16,
26977 #[doc = "Angular speed around Z axis"]
26978 pub zgyro: i16,
26979 #[doc = "X Magnetic field"]
26980 pub xmag: i16,
26981 #[doc = "Y Magnetic field"]
26982 pub ymag: i16,
26983 #[doc = "Z Magnetic field"]
26984 pub zmag: i16,
26985 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26986 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26987 pub temperature: i16,
26988}
26989impl SCALED_IMU2_DATA {
26990 pub const ENCODED_LEN: usize = 24usize;
26991 pub const DEFAULT: Self = Self {
26992 time_boot_ms: 0_u32,
26993 xacc: 0_i16,
26994 yacc: 0_i16,
26995 zacc: 0_i16,
26996 xgyro: 0_i16,
26997 ygyro: 0_i16,
26998 zgyro: 0_i16,
26999 xmag: 0_i16,
27000 ymag: 0_i16,
27001 zmag: 0_i16,
27002 temperature: 0_i16,
27003 };
27004 #[cfg(feature = "arbitrary")]
27005 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27006 use arbitrary::{Arbitrary, Unstructured};
27007 let mut buf = [0u8; 1024];
27008 rng.fill_bytes(&mut buf);
27009 let mut unstructured = Unstructured::new(&buf);
27010 Self::arbitrary(&mut unstructured).unwrap_or_default()
27011 }
27012}
27013impl Default for SCALED_IMU2_DATA {
27014 fn default() -> Self {
27015 Self::DEFAULT.clone()
27016 }
27017}
27018impl MessageData for SCALED_IMU2_DATA {
27019 type Message = MavMessage;
27020 const ID: u32 = 116u32;
27021 const NAME: &'static str = "SCALED_IMU2";
27022 const EXTRA_CRC: u8 = 76u8;
27023 const ENCODED_LEN: usize = 24usize;
27024 fn deser(
27025 _version: MavlinkVersion,
27026 __input: &[u8],
27027 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27028 let avail_len = __input.len();
27029 let mut payload_buf = [0; Self::ENCODED_LEN];
27030 let mut buf = if avail_len < Self::ENCODED_LEN {
27031 payload_buf[0..avail_len].copy_from_slice(__input);
27032 Bytes::new(&payload_buf)
27033 } else {
27034 Bytes::new(__input)
27035 };
27036 let mut __struct = Self::default();
27037 __struct.time_boot_ms = buf.get_u32_le();
27038 __struct.xacc = buf.get_i16_le();
27039 __struct.yacc = buf.get_i16_le();
27040 __struct.zacc = buf.get_i16_le();
27041 __struct.xgyro = buf.get_i16_le();
27042 __struct.ygyro = buf.get_i16_le();
27043 __struct.zgyro = buf.get_i16_le();
27044 __struct.xmag = buf.get_i16_le();
27045 __struct.ymag = buf.get_i16_le();
27046 __struct.zmag = buf.get_i16_le();
27047 __struct.temperature = buf.get_i16_le();
27048 Ok(__struct)
27049 }
27050 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27051 let mut __tmp = BytesMut::new(bytes);
27052 #[allow(clippy::absurd_extreme_comparisons)]
27053 #[allow(unused_comparisons)]
27054 if __tmp.remaining() < Self::ENCODED_LEN {
27055 panic!(
27056 "buffer is too small (need {} bytes, but got {})",
27057 Self::ENCODED_LEN,
27058 __tmp.remaining(),
27059 )
27060 }
27061 __tmp.put_u32_le(self.time_boot_ms);
27062 __tmp.put_i16_le(self.xacc);
27063 __tmp.put_i16_le(self.yacc);
27064 __tmp.put_i16_le(self.zacc);
27065 __tmp.put_i16_le(self.xgyro);
27066 __tmp.put_i16_le(self.ygyro);
27067 __tmp.put_i16_le(self.zgyro);
27068 __tmp.put_i16_le(self.xmag);
27069 __tmp.put_i16_le(self.ymag);
27070 __tmp.put_i16_le(self.zmag);
27071 if matches!(version, MavlinkVersion::V2) {
27072 __tmp.put_i16_le(self.temperature);
27073 let len = __tmp.len();
27074 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27075 } else {
27076 __tmp.len()
27077 }
27078 }
27079}
27080#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
27081#[doc = ""]
27082#[doc = "ID: 129"]
27083#[derive(Debug, Clone, PartialEq)]
27084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27085#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27086#[cfg_attr(feature = "ts", derive(TS))]
27087#[cfg_attr(feature = "ts", ts(export))]
27088pub struct SCALED_IMU3_DATA {
27089 #[doc = "Timestamp (time since system boot)."]
27090 pub time_boot_ms: u32,
27091 #[doc = "X acceleration"]
27092 pub xacc: i16,
27093 #[doc = "Y acceleration"]
27094 pub yacc: i16,
27095 #[doc = "Z acceleration"]
27096 pub zacc: i16,
27097 #[doc = "Angular speed around X axis"]
27098 pub xgyro: i16,
27099 #[doc = "Angular speed around Y axis"]
27100 pub ygyro: i16,
27101 #[doc = "Angular speed around Z axis"]
27102 pub zgyro: i16,
27103 #[doc = "X Magnetic field"]
27104 pub xmag: i16,
27105 #[doc = "Y Magnetic field"]
27106 pub ymag: i16,
27107 #[doc = "Z Magnetic field"]
27108 pub zmag: i16,
27109 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27110 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27111 pub temperature: i16,
27112}
27113impl SCALED_IMU3_DATA {
27114 pub const ENCODED_LEN: usize = 24usize;
27115 pub const DEFAULT: Self = Self {
27116 time_boot_ms: 0_u32,
27117 xacc: 0_i16,
27118 yacc: 0_i16,
27119 zacc: 0_i16,
27120 xgyro: 0_i16,
27121 ygyro: 0_i16,
27122 zgyro: 0_i16,
27123 xmag: 0_i16,
27124 ymag: 0_i16,
27125 zmag: 0_i16,
27126 temperature: 0_i16,
27127 };
27128 #[cfg(feature = "arbitrary")]
27129 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27130 use arbitrary::{Arbitrary, Unstructured};
27131 let mut buf = [0u8; 1024];
27132 rng.fill_bytes(&mut buf);
27133 let mut unstructured = Unstructured::new(&buf);
27134 Self::arbitrary(&mut unstructured).unwrap_or_default()
27135 }
27136}
27137impl Default for SCALED_IMU3_DATA {
27138 fn default() -> Self {
27139 Self::DEFAULT.clone()
27140 }
27141}
27142impl MessageData for SCALED_IMU3_DATA {
27143 type Message = MavMessage;
27144 const ID: u32 = 129u32;
27145 const NAME: &'static str = "SCALED_IMU3";
27146 const EXTRA_CRC: u8 = 46u8;
27147 const ENCODED_LEN: usize = 24usize;
27148 fn deser(
27149 _version: MavlinkVersion,
27150 __input: &[u8],
27151 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27152 let avail_len = __input.len();
27153 let mut payload_buf = [0; Self::ENCODED_LEN];
27154 let mut buf = if avail_len < Self::ENCODED_LEN {
27155 payload_buf[0..avail_len].copy_from_slice(__input);
27156 Bytes::new(&payload_buf)
27157 } else {
27158 Bytes::new(__input)
27159 };
27160 let mut __struct = Self::default();
27161 __struct.time_boot_ms = buf.get_u32_le();
27162 __struct.xacc = buf.get_i16_le();
27163 __struct.yacc = buf.get_i16_le();
27164 __struct.zacc = buf.get_i16_le();
27165 __struct.xgyro = buf.get_i16_le();
27166 __struct.ygyro = buf.get_i16_le();
27167 __struct.zgyro = buf.get_i16_le();
27168 __struct.xmag = buf.get_i16_le();
27169 __struct.ymag = buf.get_i16_le();
27170 __struct.zmag = buf.get_i16_le();
27171 __struct.temperature = buf.get_i16_le();
27172 Ok(__struct)
27173 }
27174 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27175 let mut __tmp = BytesMut::new(bytes);
27176 #[allow(clippy::absurd_extreme_comparisons)]
27177 #[allow(unused_comparisons)]
27178 if __tmp.remaining() < Self::ENCODED_LEN {
27179 panic!(
27180 "buffer is too small (need {} bytes, but got {})",
27181 Self::ENCODED_LEN,
27182 __tmp.remaining(),
27183 )
27184 }
27185 __tmp.put_u32_le(self.time_boot_ms);
27186 __tmp.put_i16_le(self.xacc);
27187 __tmp.put_i16_le(self.yacc);
27188 __tmp.put_i16_le(self.zacc);
27189 __tmp.put_i16_le(self.xgyro);
27190 __tmp.put_i16_le(self.ygyro);
27191 __tmp.put_i16_le(self.zgyro);
27192 __tmp.put_i16_le(self.xmag);
27193 __tmp.put_i16_le(self.ymag);
27194 __tmp.put_i16_le(self.zmag);
27195 if matches!(version, MavlinkVersion::V2) {
27196 __tmp.put_i16_le(self.temperature);
27197 let len = __tmp.len();
27198 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27199 } else {
27200 __tmp.len()
27201 }
27202 }
27203}
27204#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
27205#[doc = ""]
27206#[doc = "ID: 29"]
27207#[derive(Debug, Clone, PartialEq)]
27208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27209#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27210#[cfg_attr(feature = "ts", derive(TS))]
27211#[cfg_attr(feature = "ts", ts(export))]
27212pub struct SCALED_PRESSURE_DATA {
27213 #[doc = "Timestamp (time since system boot)."]
27214 pub time_boot_ms: u32,
27215 #[doc = "Absolute pressure"]
27216 pub press_abs: f32,
27217 #[doc = "Differential pressure 1"]
27218 pub press_diff: f32,
27219 #[doc = "Absolute pressure temperature"]
27220 pub temperature: i16,
27221 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27222 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27223 pub temperature_press_diff: i16,
27224}
27225impl SCALED_PRESSURE_DATA {
27226 pub const ENCODED_LEN: usize = 16usize;
27227 pub const DEFAULT: Self = Self {
27228 time_boot_ms: 0_u32,
27229 press_abs: 0.0_f32,
27230 press_diff: 0.0_f32,
27231 temperature: 0_i16,
27232 temperature_press_diff: 0_i16,
27233 };
27234 #[cfg(feature = "arbitrary")]
27235 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27236 use arbitrary::{Arbitrary, Unstructured};
27237 let mut buf = [0u8; 1024];
27238 rng.fill_bytes(&mut buf);
27239 let mut unstructured = Unstructured::new(&buf);
27240 Self::arbitrary(&mut unstructured).unwrap_or_default()
27241 }
27242}
27243impl Default for SCALED_PRESSURE_DATA {
27244 fn default() -> Self {
27245 Self::DEFAULT.clone()
27246 }
27247}
27248impl MessageData for SCALED_PRESSURE_DATA {
27249 type Message = MavMessage;
27250 const ID: u32 = 29u32;
27251 const NAME: &'static str = "SCALED_PRESSURE";
27252 const EXTRA_CRC: u8 = 115u8;
27253 const ENCODED_LEN: usize = 16usize;
27254 fn deser(
27255 _version: MavlinkVersion,
27256 __input: &[u8],
27257 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27258 let avail_len = __input.len();
27259 let mut payload_buf = [0; Self::ENCODED_LEN];
27260 let mut buf = if avail_len < Self::ENCODED_LEN {
27261 payload_buf[0..avail_len].copy_from_slice(__input);
27262 Bytes::new(&payload_buf)
27263 } else {
27264 Bytes::new(__input)
27265 };
27266 let mut __struct = Self::default();
27267 __struct.time_boot_ms = buf.get_u32_le();
27268 __struct.press_abs = buf.get_f32_le();
27269 __struct.press_diff = buf.get_f32_le();
27270 __struct.temperature = buf.get_i16_le();
27271 __struct.temperature_press_diff = buf.get_i16_le();
27272 Ok(__struct)
27273 }
27274 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27275 let mut __tmp = BytesMut::new(bytes);
27276 #[allow(clippy::absurd_extreme_comparisons)]
27277 #[allow(unused_comparisons)]
27278 if __tmp.remaining() < Self::ENCODED_LEN {
27279 panic!(
27280 "buffer is too small (need {} bytes, but got {})",
27281 Self::ENCODED_LEN,
27282 __tmp.remaining(),
27283 )
27284 }
27285 __tmp.put_u32_le(self.time_boot_ms);
27286 __tmp.put_f32_le(self.press_abs);
27287 __tmp.put_f32_le(self.press_diff);
27288 __tmp.put_i16_le(self.temperature);
27289 if matches!(version, MavlinkVersion::V2) {
27290 __tmp.put_i16_le(self.temperature_press_diff);
27291 let len = __tmp.len();
27292 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27293 } else {
27294 __tmp.len()
27295 }
27296 }
27297}
27298#[doc = "Barometer readings for 2nd barometer."]
27299#[doc = ""]
27300#[doc = "ID: 137"]
27301#[derive(Debug, Clone, PartialEq)]
27302#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27303#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27304#[cfg_attr(feature = "ts", derive(TS))]
27305#[cfg_attr(feature = "ts", ts(export))]
27306pub struct SCALED_PRESSURE2_DATA {
27307 #[doc = "Timestamp (time since system boot)."]
27308 pub time_boot_ms: u32,
27309 #[doc = "Absolute pressure"]
27310 pub press_abs: f32,
27311 #[doc = "Differential pressure"]
27312 pub press_diff: f32,
27313 #[doc = "Absolute pressure temperature"]
27314 pub temperature: i16,
27315 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27316 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27317 pub temperature_press_diff: i16,
27318}
27319impl SCALED_PRESSURE2_DATA {
27320 pub const ENCODED_LEN: usize = 16usize;
27321 pub const DEFAULT: Self = Self {
27322 time_boot_ms: 0_u32,
27323 press_abs: 0.0_f32,
27324 press_diff: 0.0_f32,
27325 temperature: 0_i16,
27326 temperature_press_diff: 0_i16,
27327 };
27328 #[cfg(feature = "arbitrary")]
27329 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27330 use arbitrary::{Arbitrary, Unstructured};
27331 let mut buf = [0u8; 1024];
27332 rng.fill_bytes(&mut buf);
27333 let mut unstructured = Unstructured::new(&buf);
27334 Self::arbitrary(&mut unstructured).unwrap_or_default()
27335 }
27336}
27337impl Default for SCALED_PRESSURE2_DATA {
27338 fn default() -> Self {
27339 Self::DEFAULT.clone()
27340 }
27341}
27342impl MessageData for SCALED_PRESSURE2_DATA {
27343 type Message = MavMessage;
27344 const ID: u32 = 137u32;
27345 const NAME: &'static str = "SCALED_PRESSURE2";
27346 const EXTRA_CRC: u8 = 195u8;
27347 const ENCODED_LEN: usize = 16usize;
27348 fn deser(
27349 _version: MavlinkVersion,
27350 __input: &[u8],
27351 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27352 let avail_len = __input.len();
27353 let mut payload_buf = [0; Self::ENCODED_LEN];
27354 let mut buf = if avail_len < Self::ENCODED_LEN {
27355 payload_buf[0..avail_len].copy_from_slice(__input);
27356 Bytes::new(&payload_buf)
27357 } else {
27358 Bytes::new(__input)
27359 };
27360 let mut __struct = Self::default();
27361 __struct.time_boot_ms = buf.get_u32_le();
27362 __struct.press_abs = buf.get_f32_le();
27363 __struct.press_diff = buf.get_f32_le();
27364 __struct.temperature = buf.get_i16_le();
27365 __struct.temperature_press_diff = buf.get_i16_le();
27366 Ok(__struct)
27367 }
27368 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27369 let mut __tmp = BytesMut::new(bytes);
27370 #[allow(clippy::absurd_extreme_comparisons)]
27371 #[allow(unused_comparisons)]
27372 if __tmp.remaining() < Self::ENCODED_LEN {
27373 panic!(
27374 "buffer is too small (need {} bytes, but got {})",
27375 Self::ENCODED_LEN,
27376 __tmp.remaining(),
27377 )
27378 }
27379 __tmp.put_u32_le(self.time_boot_ms);
27380 __tmp.put_f32_le(self.press_abs);
27381 __tmp.put_f32_le(self.press_diff);
27382 __tmp.put_i16_le(self.temperature);
27383 if matches!(version, MavlinkVersion::V2) {
27384 __tmp.put_i16_le(self.temperature_press_diff);
27385 let len = __tmp.len();
27386 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27387 } else {
27388 __tmp.len()
27389 }
27390 }
27391}
27392#[doc = "Barometer readings for 3rd barometer."]
27393#[doc = ""]
27394#[doc = "ID: 143"]
27395#[derive(Debug, Clone, PartialEq)]
27396#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27397#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27398#[cfg_attr(feature = "ts", derive(TS))]
27399#[cfg_attr(feature = "ts", ts(export))]
27400pub struct SCALED_PRESSURE3_DATA {
27401 #[doc = "Timestamp (time since system boot)."]
27402 pub time_boot_ms: u32,
27403 #[doc = "Absolute pressure"]
27404 pub press_abs: f32,
27405 #[doc = "Differential pressure"]
27406 pub press_diff: f32,
27407 #[doc = "Absolute pressure temperature"]
27408 pub temperature: i16,
27409 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27410 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27411 pub temperature_press_diff: i16,
27412}
27413impl SCALED_PRESSURE3_DATA {
27414 pub const ENCODED_LEN: usize = 16usize;
27415 pub const DEFAULT: Self = Self {
27416 time_boot_ms: 0_u32,
27417 press_abs: 0.0_f32,
27418 press_diff: 0.0_f32,
27419 temperature: 0_i16,
27420 temperature_press_diff: 0_i16,
27421 };
27422 #[cfg(feature = "arbitrary")]
27423 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27424 use arbitrary::{Arbitrary, Unstructured};
27425 let mut buf = [0u8; 1024];
27426 rng.fill_bytes(&mut buf);
27427 let mut unstructured = Unstructured::new(&buf);
27428 Self::arbitrary(&mut unstructured).unwrap_or_default()
27429 }
27430}
27431impl Default for SCALED_PRESSURE3_DATA {
27432 fn default() -> Self {
27433 Self::DEFAULT.clone()
27434 }
27435}
27436impl MessageData for SCALED_PRESSURE3_DATA {
27437 type Message = MavMessage;
27438 const ID: u32 = 143u32;
27439 const NAME: &'static str = "SCALED_PRESSURE3";
27440 const EXTRA_CRC: u8 = 131u8;
27441 const ENCODED_LEN: usize = 16usize;
27442 fn deser(
27443 _version: MavlinkVersion,
27444 __input: &[u8],
27445 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27446 let avail_len = __input.len();
27447 let mut payload_buf = [0; Self::ENCODED_LEN];
27448 let mut buf = if avail_len < Self::ENCODED_LEN {
27449 payload_buf[0..avail_len].copy_from_slice(__input);
27450 Bytes::new(&payload_buf)
27451 } else {
27452 Bytes::new(__input)
27453 };
27454 let mut __struct = Self::default();
27455 __struct.time_boot_ms = buf.get_u32_le();
27456 __struct.press_abs = buf.get_f32_le();
27457 __struct.press_diff = buf.get_f32_le();
27458 __struct.temperature = buf.get_i16_le();
27459 __struct.temperature_press_diff = buf.get_i16_le();
27460 Ok(__struct)
27461 }
27462 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27463 let mut __tmp = BytesMut::new(bytes);
27464 #[allow(clippy::absurd_extreme_comparisons)]
27465 #[allow(unused_comparisons)]
27466 if __tmp.remaining() < Self::ENCODED_LEN {
27467 panic!(
27468 "buffer is too small (need {} bytes, but got {})",
27469 Self::ENCODED_LEN,
27470 __tmp.remaining(),
27471 )
27472 }
27473 __tmp.put_u32_le(self.time_boot_ms);
27474 __tmp.put_f32_le(self.press_abs);
27475 __tmp.put_f32_le(self.press_diff);
27476 __tmp.put_i16_le(self.temperature);
27477 if matches!(version, MavlinkVersion::V2) {
27478 __tmp.put_i16_le(self.temperature_press_diff);
27479 let len = __tmp.len();
27480 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27481 } else {
27482 __tmp.len()
27483 }
27484 }
27485}
27486#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
27487#[doc = ""]
27488#[doc = "ID: 126"]
27489#[derive(Debug, Clone, PartialEq)]
27490#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27491#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27492#[cfg_attr(feature = "ts", derive(TS))]
27493#[cfg_attr(feature = "ts", ts(export))]
27494pub struct SERIAL_CONTROL_DATA {
27495 #[doc = "Baudrate of transfer. Zero means no change."]
27496 pub baudrate: u32,
27497 #[doc = "Timeout for reply data"]
27498 pub timeout: u16,
27499 #[doc = "Serial control device type."]
27500 pub device: SerialControlDev,
27501 #[doc = "Bitmap of serial control flags."]
27502 pub flags: SerialControlFlag,
27503 #[doc = "how many bytes in this transfer"]
27504 pub count: u8,
27505 #[doc = "serial data"]
27506 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27507 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27508 pub data: [u8; 70],
27509 #[doc = "System ID"]
27510 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27511 pub target_system: u8,
27512 #[doc = "Component ID"]
27513 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27514 pub target_component: u8,
27515}
27516impl SERIAL_CONTROL_DATA {
27517 pub const ENCODED_LEN: usize = 81usize;
27518 pub const DEFAULT: Self = Self {
27519 baudrate: 0_u32,
27520 timeout: 0_u16,
27521 device: SerialControlDev::DEFAULT,
27522 flags: SerialControlFlag::DEFAULT,
27523 count: 0_u8,
27524 data: [0_u8; 70usize],
27525 target_system: 0_u8,
27526 target_component: 0_u8,
27527 };
27528 #[cfg(feature = "arbitrary")]
27529 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27530 use arbitrary::{Arbitrary, Unstructured};
27531 let mut buf = [0u8; 1024];
27532 rng.fill_bytes(&mut buf);
27533 let mut unstructured = Unstructured::new(&buf);
27534 Self::arbitrary(&mut unstructured).unwrap_or_default()
27535 }
27536}
27537impl Default for SERIAL_CONTROL_DATA {
27538 fn default() -> Self {
27539 Self::DEFAULT.clone()
27540 }
27541}
27542impl MessageData for SERIAL_CONTROL_DATA {
27543 type Message = MavMessage;
27544 const ID: u32 = 126u32;
27545 const NAME: &'static str = "SERIAL_CONTROL";
27546 const EXTRA_CRC: u8 = 220u8;
27547 const ENCODED_LEN: usize = 81usize;
27548 fn deser(
27549 _version: MavlinkVersion,
27550 __input: &[u8],
27551 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27552 let avail_len = __input.len();
27553 let mut payload_buf = [0; Self::ENCODED_LEN];
27554 let mut buf = if avail_len < Self::ENCODED_LEN {
27555 payload_buf[0..avail_len].copy_from_slice(__input);
27556 Bytes::new(&payload_buf)
27557 } else {
27558 Bytes::new(__input)
27559 };
27560 let mut __struct = Self::default();
27561 __struct.baudrate = buf.get_u32_le();
27562 __struct.timeout = buf.get_u16_le();
27563 let tmp = buf.get_u8();
27564 __struct.device =
27565 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27566 enum_type: "SerialControlDev",
27567 value: tmp as u64,
27568 })?;
27569 let tmp = buf.get_u8();
27570 __struct.flags = SerialControlFlag::from_bits(tmp as <SerialControlFlag as Flags>::Bits)
27571 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27572 flag_type: "SerialControlFlag",
27573 value: tmp as u64,
27574 })?;
27575 __struct.count = buf.get_u8();
27576 for v in &mut __struct.data {
27577 let val = buf.get_u8();
27578 *v = val;
27579 }
27580 __struct.target_system = buf.get_u8();
27581 __struct.target_component = buf.get_u8();
27582 Ok(__struct)
27583 }
27584 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27585 let mut __tmp = BytesMut::new(bytes);
27586 #[allow(clippy::absurd_extreme_comparisons)]
27587 #[allow(unused_comparisons)]
27588 if __tmp.remaining() < Self::ENCODED_LEN {
27589 panic!(
27590 "buffer is too small (need {} bytes, but got {})",
27591 Self::ENCODED_LEN,
27592 __tmp.remaining(),
27593 )
27594 }
27595 __tmp.put_u32_le(self.baudrate);
27596 __tmp.put_u16_le(self.timeout);
27597 __tmp.put_u8(self.device as u8);
27598 __tmp.put_u8(self.flags.bits() as u8);
27599 __tmp.put_u8(self.count);
27600 for val in &self.data {
27601 __tmp.put_u8(*val);
27602 }
27603 if matches!(version, MavlinkVersion::V2) {
27604 __tmp.put_u8(self.target_system);
27605 __tmp.put_u8(self.target_component);
27606 let len = __tmp.len();
27607 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27608 } else {
27609 __tmp.len()
27610 }
27611 }
27612}
27613#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
27614#[doc = ""]
27615#[doc = "ID: 36"]
27616#[derive(Debug, Clone, PartialEq)]
27617#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27618#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27619#[cfg_attr(feature = "ts", derive(TS))]
27620#[cfg_attr(feature = "ts", ts(export))]
27621pub struct SERVO_OUTPUT_RAW_DATA {
27622 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27623 pub time_usec: u32,
27624 #[doc = "Servo output 1 value"]
27625 pub servo1_raw: u16,
27626 #[doc = "Servo output 2 value"]
27627 pub servo2_raw: u16,
27628 #[doc = "Servo output 3 value"]
27629 pub servo3_raw: u16,
27630 #[doc = "Servo output 4 value"]
27631 pub servo4_raw: u16,
27632 #[doc = "Servo output 5 value"]
27633 pub servo5_raw: u16,
27634 #[doc = "Servo output 6 value"]
27635 pub servo6_raw: u16,
27636 #[doc = "Servo output 7 value"]
27637 pub servo7_raw: u16,
27638 #[doc = "Servo output 8 value"]
27639 pub servo8_raw: u16,
27640 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
27641 pub port: u8,
27642 #[doc = "Servo output 9 value"]
27643 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27644 pub servo9_raw: u16,
27645 #[doc = "Servo output 10 value"]
27646 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27647 pub servo10_raw: u16,
27648 #[doc = "Servo output 11 value"]
27649 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27650 pub servo11_raw: u16,
27651 #[doc = "Servo output 12 value"]
27652 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27653 pub servo12_raw: u16,
27654 #[doc = "Servo output 13 value"]
27655 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27656 pub servo13_raw: u16,
27657 #[doc = "Servo output 14 value"]
27658 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27659 pub servo14_raw: u16,
27660 #[doc = "Servo output 15 value"]
27661 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27662 pub servo15_raw: u16,
27663 #[doc = "Servo output 16 value"]
27664 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27665 pub servo16_raw: u16,
27666}
27667impl SERVO_OUTPUT_RAW_DATA {
27668 pub const ENCODED_LEN: usize = 37usize;
27669 pub const DEFAULT: Self = Self {
27670 time_usec: 0_u32,
27671 servo1_raw: 0_u16,
27672 servo2_raw: 0_u16,
27673 servo3_raw: 0_u16,
27674 servo4_raw: 0_u16,
27675 servo5_raw: 0_u16,
27676 servo6_raw: 0_u16,
27677 servo7_raw: 0_u16,
27678 servo8_raw: 0_u16,
27679 port: 0_u8,
27680 servo9_raw: 0_u16,
27681 servo10_raw: 0_u16,
27682 servo11_raw: 0_u16,
27683 servo12_raw: 0_u16,
27684 servo13_raw: 0_u16,
27685 servo14_raw: 0_u16,
27686 servo15_raw: 0_u16,
27687 servo16_raw: 0_u16,
27688 };
27689 #[cfg(feature = "arbitrary")]
27690 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27691 use arbitrary::{Arbitrary, Unstructured};
27692 let mut buf = [0u8; 1024];
27693 rng.fill_bytes(&mut buf);
27694 let mut unstructured = Unstructured::new(&buf);
27695 Self::arbitrary(&mut unstructured).unwrap_or_default()
27696 }
27697}
27698impl Default for SERVO_OUTPUT_RAW_DATA {
27699 fn default() -> Self {
27700 Self::DEFAULT.clone()
27701 }
27702}
27703impl MessageData for SERVO_OUTPUT_RAW_DATA {
27704 type Message = MavMessage;
27705 const ID: u32 = 36u32;
27706 const NAME: &'static str = "SERVO_OUTPUT_RAW";
27707 const EXTRA_CRC: u8 = 222u8;
27708 const ENCODED_LEN: usize = 37usize;
27709 fn deser(
27710 _version: MavlinkVersion,
27711 __input: &[u8],
27712 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27713 let avail_len = __input.len();
27714 let mut payload_buf = [0; Self::ENCODED_LEN];
27715 let mut buf = if avail_len < Self::ENCODED_LEN {
27716 payload_buf[0..avail_len].copy_from_slice(__input);
27717 Bytes::new(&payload_buf)
27718 } else {
27719 Bytes::new(__input)
27720 };
27721 let mut __struct = Self::default();
27722 __struct.time_usec = buf.get_u32_le();
27723 __struct.servo1_raw = buf.get_u16_le();
27724 __struct.servo2_raw = buf.get_u16_le();
27725 __struct.servo3_raw = buf.get_u16_le();
27726 __struct.servo4_raw = buf.get_u16_le();
27727 __struct.servo5_raw = buf.get_u16_le();
27728 __struct.servo6_raw = buf.get_u16_le();
27729 __struct.servo7_raw = buf.get_u16_le();
27730 __struct.servo8_raw = buf.get_u16_le();
27731 __struct.port = buf.get_u8();
27732 __struct.servo9_raw = buf.get_u16_le();
27733 __struct.servo10_raw = buf.get_u16_le();
27734 __struct.servo11_raw = buf.get_u16_le();
27735 __struct.servo12_raw = buf.get_u16_le();
27736 __struct.servo13_raw = buf.get_u16_le();
27737 __struct.servo14_raw = buf.get_u16_le();
27738 __struct.servo15_raw = buf.get_u16_le();
27739 __struct.servo16_raw = buf.get_u16_le();
27740 Ok(__struct)
27741 }
27742 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27743 let mut __tmp = BytesMut::new(bytes);
27744 #[allow(clippy::absurd_extreme_comparisons)]
27745 #[allow(unused_comparisons)]
27746 if __tmp.remaining() < Self::ENCODED_LEN {
27747 panic!(
27748 "buffer is too small (need {} bytes, but got {})",
27749 Self::ENCODED_LEN,
27750 __tmp.remaining(),
27751 )
27752 }
27753 __tmp.put_u32_le(self.time_usec);
27754 __tmp.put_u16_le(self.servo1_raw);
27755 __tmp.put_u16_le(self.servo2_raw);
27756 __tmp.put_u16_le(self.servo3_raw);
27757 __tmp.put_u16_le(self.servo4_raw);
27758 __tmp.put_u16_le(self.servo5_raw);
27759 __tmp.put_u16_le(self.servo6_raw);
27760 __tmp.put_u16_le(self.servo7_raw);
27761 __tmp.put_u16_le(self.servo8_raw);
27762 __tmp.put_u8(self.port);
27763 if matches!(version, MavlinkVersion::V2) {
27764 __tmp.put_u16_le(self.servo9_raw);
27765 __tmp.put_u16_le(self.servo10_raw);
27766 __tmp.put_u16_le(self.servo11_raw);
27767 __tmp.put_u16_le(self.servo12_raw);
27768 __tmp.put_u16_le(self.servo13_raw);
27769 __tmp.put_u16_le(self.servo14_raw);
27770 __tmp.put_u16_le(self.servo15_raw);
27771 __tmp.put_u16_le(self.servo16_raw);
27772 let len = __tmp.len();
27773 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27774 } else {
27775 __tmp.len()
27776 }
27777 }
27778}
27779#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
27780#[doc = ""]
27781#[doc = "ID: 256"]
27782#[derive(Debug, Clone, PartialEq)]
27783#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27784#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27785#[cfg_attr(feature = "ts", derive(TS))]
27786#[cfg_attr(feature = "ts", ts(export))]
27787pub struct SETUP_SIGNING_DATA {
27788 #[doc = "initial timestamp"]
27789 pub initial_timestamp: u64,
27790 #[doc = "system id of the target"]
27791 pub target_system: u8,
27792 #[doc = "component ID of the target"]
27793 pub target_component: u8,
27794 #[doc = "signing key"]
27795 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27796 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27797 pub secret_key: [u8; 32],
27798}
27799impl SETUP_SIGNING_DATA {
27800 pub const ENCODED_LEN: usize = 42usize;
27801 pub const DEFAULT: Self = Self {
27802 initial_timestamp: 0_u64,
27803 target_system: 0_u8,
27804 target_component: 0_u8,
27805 secret_key: [0_u8; 32usize],
27806 };
27807 #[cfg(feature = "arbitrary")]
27808 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27809 use arbitrary::{Arbitrary, Unstructured};
27810 let mut buf = [0u8; 1024];
27811 rng.fill_bytes(&mut buf);
27812 let mut unstructured = Unstructured::new(&buf);
27813 Self::arbitrary(&mut unstructured).unwrap_or_default()
27814 }
27815}
27816impl Default for SETUP_SIGNING_DATA {
27817 fn default() -> Self {
27818 Self::DEFAULT.clone()
27819 }
27820}
27821impl MessageData for SETUP_SIGNING_DATA {
27822 type Message = MavMessage;
27823 const ID: u32 = 256u32;
27824 const NAME: &'static str = "SETUP_SIGNING";
27825 const EXTRA_CRC: u8 = 71u8;
27826 const ENCODED_LEN: usize = 42usize;
27827 fn deser(
27828 _version: MavlinkVersion,
27829 __input: &[u8],
27830 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27831 let avail_len = __input.len();
27832 let mut payload_buf = [0; Self::ENCODED_LEN];
27833 let mut buf = if avail_len < Self::ENCODED_LEN {
27834 payload_buf[0..avail_len].copy_from_slice(__input);
27835 Bytes::new(&payload_buf)
27836 } else {
27837 Bytes::new(__input)
27838 };
27839 let mut __struct = Self::default();
27840 __struct.initial_timestamp = buf.get_u64_le();
27841 __struct.target_system = buf.get_u8();
27842 __struct.target_component = buf.get_u8();
27843 for v in &mut __struct.secret_key {
27844 let val = buf.get_u8();
27845 *v = val;
27846 }
27847 Ok(__struct)
27848 }
27849 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27850 let mut __tmp = BytesMut::new(bytes);
27851 #[allow(clippy::absurd_extreme_comparisons)]
27852 #[allow(unused_comparisons)]
27853 if __tmp.remaining() < Self::ENCODED_LEN {
27854 panic!(
27855 "buffer is too small (need {} bytes, but got {})",
27856 Self::ENCODED_LEN,
27857 __tmp.remaining(),
27858 )
27859 }
27860 __tmp.put_u64_le(self.initial_timestamp);
27861 __tmp.put_u8(self.target_system);
27862 __tmp.put_u8(self.target_component);
27863 for val in &self.secret_key {
27864 __tmp.put_u8(*val);
27865 }
27866 if matches!(version, MavlinkVersion::V2) {
27867 let len = __tmp.len();
27868 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27869 } else {
27870 __tmp.len()
27871 }
27872 }
27873}
27874#[doc = "Set the vehicle attitude and body angular rates."]
27875#[doc = ""]
27876#[doc = "ID: 139"]
27877#[derive(Debug, Clone, PartialEq)]
27878#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27879#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27880#[cfg_attr(feature = "ts", derive(TS))]
27881#[cfg_attr(feature = "ts", ts(export))]
27882pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
27883 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27884 pub time_usec: u64,
27885 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
27886 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27887 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27888 pub controls: [f32; 8],
27889 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
27890 pub group_mlx: u8,
27891 #[doc = "System ID"]
27892 pub target_system: u8,
27893 #[doc = "Component ID"]
27894 pub target_component: u8,
27895}
27896impl SET_ACTUATOR_CONTROL_TARGET_DATA {
27897 pub const ENCODED_LEN: usize = 43usize;
27898 pub const DEFAULT: Self = Self {
27899 time_usec: 0_u64,
27900 controls: [0.0_f32; 8usize],
27901 group_mlx: 0_u8,
27902 target_system: 0_u8,
27903 target_component: 0_u8,
27904 };
27905 #[cfg(feature = "arbitrary")]
27906 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27907 use arbitrary::{Arbitrary, Unstructured};
27908 let mut buf = [0u8; 1024];
27909 rng.fill_bytes(&mut buf);
27910 let mut unstructured = Unstructured::new(&buf);
27911 Self::arbitrary(&mut unstructured).unwrap_or_default()
27912 }
27913}
27914impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
27915 fn default() -> Self {
27916 Self::DEFAULT.clone()
27917 }
27918}
27919impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
27920 type Message = MavMessage;
27921 const ID: u32 = 139u32;
27922 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
27923 const EXTRA_CRC: u8 = 168u8;
27924 const ENCODED_LEN: usize = 43usize;
27925 fn deser(
27926 _version: MavlinkVersion,
27927 __input: &[u8],
27928 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27929 let avail_len = __input.len();
27930 let mut payload_buf = [0; Self::ENCODED_LEN];
27931 let mut buf = if avail_len < Self::ENCODED_LEN {
27932 payload_buf[0..avail_len].copy_from_slice(__input);
27933 Bytes::new(&payload_buf)
27934 } else {
27935 Bytes::new(__input)
27936 };
27937 let mut __struct = Self::default();
27938 __struct.time_usec = buf.get_u64_le();
27939 for v in &mut __struct.controls {
27940 let val = buf.get_f32_le();
27941 *v = val;
27942 }
27943 __struct.group_mlx = buf.get_u8();
27944 __struct.target_system = buf.get_u8();
27945 __struct.target_component = buf.get_u8();
27946 Ok(__struct)
27947 }
27948 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27949 let mut __tmp = BytesMut::new(bytes);
27950 #[allow(clippy::absurd_extreme_comparisons)]
27951 #[allow(unused_comparisons)]
27952 if __tmp.remaining() < Self::ENCODED_LEN {
27953 panic!(
27954 "buffer is too small (need {} bytes, but got {})",
27955 Self::ENCODED_LEN,
27956 __tmp.remaining(),
27957 )
27958 }
27959 __tmp.put_u64_le(self.time_usec);
27960 for val in &self.controls {
27961 __tmp.put_f32_le(*val);
27962 }
27963 __tmp.put_u8(self.group_mlx);
27964 __tmp.put_u8(self.target_system);
27965 __tmp.put_u8(self.target_component);
27966 if matches!(version, MavlinkVersion::V2) {
27967 let len = __tmp.len();
27968 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27969 } else {
27970 __tmp.len()
27971 }
27972 }
27973}
27974#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
27975#[doc = ""]
27976#[doc = "ID: 82"]
27977#[derive(Debug, Clone, PartialEq)]
27978#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27979#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27980#[cfg_attr(feature = "ts", derive(TS))]
27981#[cfg_attr(feature = "ts", ts(export))]
27982pub struct SET_ATTITUDE_TARGET_DATA {
27983 #[doc = "Timestamp (time since system boot)."]
27984 pub time_boot_ms: u32,
27985 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
27986 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27987 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27988 pub q: [f32; 4],
27989 #[doc = "Body roll rate"]
27990 pub body_roll_rate: f32,
27991 #[doc = "Body pitch rate"]
27992 pub body_pitch_rate: f32,
27993 #[doc = "Body yaw rate"]
27994 pub body_yaw_rate: f32,
27995 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
27996 pub thrust: f32,
27997 #[doc = "System ID"]
27998 pub target_system: u8,
27999 #[doc = "Component ID"]
28000 pub target_component: u8,
28001 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28002 pub type_mask: AttitudeTargetTypemask,
28003 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
28004 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28005 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28006 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28007 pub thrust_body: [f32; 3],
28008}
28009impl SET_ATTITUDE_TARGET_DATA {
28010 pub const ENCODED_LEN: usize = 51usize;
28011 pub const DEFAULT: Self = Self {
28012 time_boot_ms: 0_u32,
28013 q: [0.0_f32; 4usize],
28014 body_roll_rate: 0.0_f32,
28015 body_pitch_rate: 0.0_f32,
28016 body_yaw_rate: 0.0_f32,
28017 thrust: 0.0_f32,
28018 target_system: 0_u8,
28019 target_component: 0_u8,
28020 type_mask: AttitudeTargetTypemask::DEFAULT,
28021 thrust_body: [0.0_f32; 3usize],
28022 };
28023 #[cfg(feature = "arbitrary")]
28024 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28025 use arbitrary::{Arbitrary, Unstructured};
28026 let mut buf = [0u8; 1024];
28027 rng.fill_bytes(&mut buf);
28028 let mut unstructured = Unstructured::new(&buf);
28029 Self::arbitrary(&mut unstructured).unwrap_or_default()
28030 }
28031}
28032impl Default for SET_ATTITUDE_TARGET_DATA {
28033 fn default() -> Self {
28034 Self::DEFAULT.clone()
28035 }
28036}
28037impl MessageData for SET_ATTITUDE_TARGET_DATA {
28038 type Message = MavMessage;
28039 const ID: u32 = 82u32;
28040 const NAME: &'static str = "SET_ATTITUDE_TARGET";
28041 const EXTRA_CRC: u8 = 49u8;
28042 const ENCODED_LEN: usize = 51usize;
28043 fn deser(
28044 _version: MavlinkVersion,
28045 __input: &[u8],
28046 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28047 let avail_len = __input.len();
28048 let mut payload_buf = [0; Self::ENCODED_LEN];
28049 let mut buf = if avail_len < Self::ENCODED_LEN {
28050 payload_buf[0..avail_len].copy_from_slice(__input);
28051 Bytes::new(&payload_buf)
28052 } else {
28053 Bytes::new(__input)
28054 };
28055 let mut __struct = Self::default();
28056 __struct.time_boot_ms = buf.get_u32_le();
28057 for v in &mut __struct.q {
28058 let val = buf.get_f32_le();
28059 *v = val;
28060 }
28061 __struct.body_roll_rate = buf.get_f32_le();
28062 __struct.body_pitch_rate = buf.get_f32_le();
28063 __struct.body_yaw_rate = buf.get_f32_le();
28064 __struct.thrust = buf.get_f32_le();
28065 __struct.target_system = buf.get_u8();
28066 __struct.target_component = buf.get_u8();
28067 let tmp = buf.get_u8();
28068 __struct.type_mask =
28069 AttitudeTargetTypemask::from_bits(tmp as <AttitudeTargetTypemask as Flags>::Bits)
28070 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28071 flag_type: "AttitudeTargetTypemask",
28072 value: tmp as u64,
28073 })?;
28074 for v in &mut __struct.thrust_body {
28075 let val = buf.get_f32_le();
28076 *v = val;
28077 }
28078 Ok(__struct)
28079 }
28080 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28081 let mut __tmp = BytesMut::new(bytes);
28082 #[allow(clippy::absurd_extreme_comparisons)]
28083 #[allow(unused_comparisons)]
28084 if __tmp.remaining() < Self::ENCODED_LEN {
28085 panic!(
28086 "buffer is too small (need {} bytes, but got {})",
28087 Self::ENCODED_LEN,
28088 __tmp.remaining(),
28089 )
28090 }
28091 __tmp.put_u32_le(self.time_boot_ms);
28092 for val in &self.q {
28093 __tmp.put_f32_le(*val);
28094 }
28095 __tmp.put_f32_le(self.body_roll_rate);
28096 __tmp.put_f32_le(self.body_pitch_rate);
28097 __tmp.put_f32_le(self.body_yaw_rate);
28098 __tmp.put_f32_le(self.thrust);
28099 __tmp.put_u8(self.target_system);
28100 __tmp.put_u8(self.target_component);
28101 __tmp.put_u8(self.type_mask.bits() as u8);
28102 if matches!(version, MavlinkVersion::V2) {
28103 for val in &self.thrust_body {
28104 __tmp.put_f32_le(*val);
28105 }
28106 let len = __tmp.len();
28107 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28108 } else {
28109 __tmp.len()
28110 }
28111 }
28112}
28113#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
28114#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
28115#[doc = ""]
28116#[doc = "ID: 48"]
28117#[derive(Debug, Clone, PartialEq)]
28118#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28119#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28120#[cfg_attr(feature = "ts", derive(TS))]
28121#[cfg_attr(feature = "ts", ts(export))]
28122pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
28123 #[doc = "Latitude (WGS84)"]
28124 pub latitude: i32,
28125 #[doc = "Longitude (WGS84)"]
28126 pub longitude: i32,
28127 #[doc = "Altitude (MSL). Positive for up."]
28128 pub altitude: i32,
28129 #[doc = "System ID"]
28130 pub target_system: u8,
28131 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28132 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28133 pub time_usec: u64,
28134}
28135impl SET_GPS_GLOBAL_ORIGIN_DATA {
28136 pub const ENCODED_LEN: usize = 21usize;
28137 pub const DEFAULT: Self = Self {
28138 latitude: 0_i32,
28139 longitude: 0_i32,
28140 altitude: 0_i32,
28141 target_system: 0_u8,
28142 time_usec: 0_u64,
28143 };
28144 #[cfg(feature = "arbitrary")]
28145 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28146 use arbitrary::{Arbitrary, Unstructured};
28147 let mut buf = [0u8; 1024];
28148 rng.fill_bytes(&mut buf);
28149 let mut unstructured = Unstructured::new(&buf);
28150 Self::arbitrary(&mut unstructured).unwrap_or_default()
28151 }
28152}
28153impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
28154 fn default() -> Self {
28155 Self::DEFAULT.clone()
28156 }
28157}
28158impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
28159 type Message = MavMessage;
28160 const ID: u32 = 48u32;
28161 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
28162 const EXTRA_CRC: u8 = 41u8;
28163 const ENCODED_LEN: usize = 21usize;
28164 fn deser(
28165 _version: MavlinkVersion,
28166 __input: &[u8],
28167 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28168 let avail_len = __input.len();
28169 let mut payload_buf = [0; Self::ENCODED_LEN];
28170 let mut buf = if avail_len < Self::ENCODED_LEN {
28171 payload_buf[0..avail_len].copy_from_slice(__input);
28172 Bytes::new(&payload_buf)
28173 } else {
28174 Bytes::new(__input)
28175 };
28176 let mut __struct = Self::default();
28177 __struct.latitude = buf.get_i32_le();
28178 __struct.longitude = buf.get_i32_le();
28179 __struct.altitude = buf.get_i32_le();
28180 __struct.target_system = buf.get_u8();
28181 __struct.time_usec = buf.get_u64_le();
28182 Ok(__struct)
28183 }
28184 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28185 let mut __tmp = BytesMut::new(bytes);
28186 #[allow(clippy::absurd_extreme_comparisons)]
28187 #[allow(unused_comparisons)]
28188 if __tmp.remaining() < Self::ENCODED_LEN {
28189 panic!(
28190 "buffer is too small (need {} bytes, but got {})",
28191 Self::ENCODED_LEN,
28192 __tmp.remaining(),
28193 )
28194 }
28195 __tmp.put_i32_le(self.latitude);
28196 __tmp.put_i32_le(self.longitude);
28197 __tmp.put_i32_le(self.altitude);
28198 __tmp.put_u8(self.target_system);
28199 if matches!(version, MavlinkVersion::V2) {
28200 __tmp.put_u64_le(self.time_usec);
28201 let len = __tmp.len();
28202 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28203 } else {
28204 __tmp.len()
28205 }
28206 }
28207}
28208#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
28209#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
28210#[doc = ""]
28211#[doc = "ID: 243"]
28212#[derive(Debug, Clone, PartialEq)]
28213#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28214#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28215#[cfg_attr(feature = "ts", derive(TS))]
28216#[cfg_attr(feature = "ts", ts(export))]
28217pub struct SET_HOME_POSITION_DATA {
28218 #[doc = "Latitude (WGS84)"]
28219 pub latitude: i32,
28220 #[doc = "Longitude (WGS84)"]
28221 pub longitude: i32,
28222 #[doc = "Altitude (MSL). Positive for up."]
28223 pub altitude: i32,
28224 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
28225 pub x: f32,
28226 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
28227 pub y: f32,
28228 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
28229 pub z: f32,
28230 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
28231 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28232 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28233 pub q: [f32; 4],
28234 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28235 pub approach_x: f32,
28236 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28237 pub approach_y: f32,
28238 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28239 pub approach_z: f32,
28240 #[doc = "System ID."]
28241 pub target_system: u8,
28242 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28243 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28244 pub time_usec: u64,
28245}
28246impl SET_HOME_POSITION_DATA {
28247 pub const ENCODED_LEN: usize = 61usize;
28248 pub const DEFAULT: Self = Self {
28249 latitude: 0_i32,
28250 longitude: 0_i32,
28251 altitude: 0_i32,
28252 x: 0.0_f32,
28253 y: 0.0_f32,
28254 z: 0.0_f32,
28255 q: [0.0_f32; 4usize],
28256 approach_x: 0.0_f32,
28257 approach_y: 0.0_f32,
28258 approach_z: 0.0_f32,
28259 target_system: 0_u8,
28260 time_usec: 0_u64,
28261 };
28262 #[cfg(feature = "arbitrary")]
28263 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28264 use arbitrary::{Arbitrary, Unstructured};
28265 let mut buf = [0u8; 1024];
28266 rng.fill_bytes(&mut buf);
28267 let mut unstructured = Unstructured::new(&buf);
28268 Self::arbitrary(&mut unstructured).unwrap_or_default()
28269 }
28270}
28271impl Default for SET_HOME_POSITION_DATA {
28272 fn default() -> Self {
28273 Self::DEFAULT.clone()
28274 }
28275}
28276impl MessageData for SET_HOME_POSITION_DATA {
28277 type Message = MavMessage;
28278 const ID: u32 = 243u32;
28279 const NAME: &'static str = "SET_HOME_POSITION";
28280 const EXTRA_CRC: u8 = 85u8;
28281 const ENCODED_LEN: usize = 61usize;
28282 fn deser(
28283 _version: MavlinkVersion,
28284 __input: &[u8],
28285 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28286 let avail_len = __input.len();
28287 let mut payload_buf = [0; Self::ENCODED_LEN];
28288 let mut buf = if avail_len < Self::ENCODED_LEN {
28289 payload_buf[0..avail_len].copy_from_slice(__input);
28290 Bytes::new(&payload_buf)
28291 } else {
28292 Bytes::new(__input)
28293 };
28294 let mut __struct = Self::default();
28295 __struct.latitude = buf.get_i32_le();
28296 __struct.longitude = buf.get_i32_le();
28297 __struct.altitude = buf.get_i32_le();
28298 __struct.x = buf.get_f32_le();
28299 __struct.y = buf.get_f32_le();
28300 __struct.z = buf.get_f32_le();
28301 for v in &mut __struct.q {
28302 let val = buf.get_f32_le();
28303 *v = val;
28304 }
28305 __struct.approach_x = buf.get_f32_le();
28306 __struct.approach_y = buf.get_f32_le();
28307 __struct.approach_z = buf.get_f32_le();
28308 __struct.target_system = buf.get_u8();
28309 __struct.time_usec = buf.get_u64_le();
28310 Ok(__struct)
28311 }
28312 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28313 let mut __tmp = BytesMut::new(bytes);
28314 #[allow(clippy::absurd_extreme_comparisons)]
28315 #[allow(unused_comparisons)]
28316 if __tmp.remaining() < Self::ENCODED_LEN {
28317 panic!(
28318 "buffer is too small (need {} bytes, but got {})",
28319 Self::ENCODED_LEN,
28320 __tmp.remaining(),
28321 )
28322 }
28323 __tmp.put_i32_le(self.latitude);
28324 __tmp.put_i32_le(self.longitude);
28325 __tmp.put_i32_le(self.altitude);
28326 __tmp.put_f32_le(self.x);
28327 __tmp.put_f32_le(self.y);
28328 __tmp.put_f32_le(self.z);
28329 for val in &self.q {
28330 __tmp.put_f32_le(*val);
28331 }
28332 __tmp.put_f32_le(self.approach_x);
28333 __tmp.put_f32_le(self.approach_y);
28334 __tmp.put_f32_le(self.approach_z);
28335 __tmp.put_u8(self.target_system);
28336 if matches!(version, MavlinkVersion::V2) {
28337 __tmp.put_u64_le(self.time_usec);
28338 let len = __tmp.len();
28339 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28340 } else {
28341 __tmp.len()
28342 }
28343 }
28344}
28345#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
28346#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
28347#[doc = ""]
28348#[doc = "ID: 11"]
28349#[derive(Debug, Clone, PartialEq)]
28350#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28351#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28352#[cfg_attr(feature = "ts", derive(TS))]
28353#[cfg_attr(feature = "ts", ts(export))]
28354pub struct SET_MODE_DATA {
28355 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
28356 pub custom_mode: u32,
28357 #[doc = "The system setting the mode"]
28358 pub target_system: u8,
28359 #[doc = "The new base mode."]
28360 pub base_mode: MavMode,
28361}
28362impl SET_MODE_DATA {
28363 pub const ENCODED_LEN: usize = 6usize;
28364 pub const DEFAULT: Self = Self {
28365 custom_mode: 0_u32,
28366 target_system: 0_u8,
28367 base_mode: MavMode::DEFAULT,
28368 };
28369 #[cfg(feature = "arbitrary")]
28370 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28371 use arbitrary::{Arbitrary, Unstructured};
28372 let mut buf = [0u8; 1024];
28373 rng.fill_bytes(&mut buf);
28374 let mut unstructured = Unstructured::new(&buf);
28375 Self::arbitrary(&mut unstructured).unwrap_or_default()
28376 }
28377}
28378impl Default for SET_MODE_DATA {
28379 fn default() -> Self {
28380 Self::DEFAULT.clone()
28381 }
28382}
28383impl MessageData for SET_MODE_DATA {
28384 type Message = MavMessage;
28385 const ID: u32 = 11u32;
28386 const NAME: &'static str = "SET_MODE";
28387 const EXTRA_CRC: u8 = 89u8;
28388 const ENCODED_LEN: usize = 6usize;
28389 fn deser(
28390 _version: MavlinkVersion,
28391 __input: &[u8],
28392 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28393 let avail_len = __input.len();
28394 let mut payload_buf = [0; Self::ENCODED_LEN];
28395 let mut buf = if avail_len < Self::ENCODED_LEN {
28396 payload_buf[0..avail_len].copy_from_slice(__input);
28397 Bytes::new(&payload_buf)
28398 } else {
28399 Bytes::new(__input)
28400 };
28401 let mut __struct = Self::default();
28402 __struct.custom_mode = buf.get_u32_le();
28403 __struct.target_system = buf.get_u8();
28404 let tmp = buf.get_u8();
28405 __struct.base_mode =
28406 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28407 enum_type: "MavMode",
28408 value: tmp as u64,
28409 })?;
28410 Ok(__struct)
28411 }
28412 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28413 let mut __tmp = BytesMut::new(bytes);
28414 #[allow(clippy::absurd_extreme_comparisons)]
28415 #[allow(unused_comparisons)]
28416 if __tmp.remaining() < Self::ENCODED_LEN {
28417 panic!(
28418 "buffer is too small (need {} bytes, but got {})",
28419 Self::ENCODED_LEN,
28420 __tmp.remaining(),
28421 )
28422 }
28423 __tmp.put_u32_le(self.custom_mode);
28424 __tmp.put_u8(self.target_system);
28425 __tmp.put_u8(self.base_mode as u8);
28426 if matches!(version, MavlinkVersion::V2) {
28427 let len = __tmp.len();
28428 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28429 } else {
28430 __tmp.len()
28431 }
28432 }
28433}
28434#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
28435#[doc = ""]
28436#[doc = "ID: 86"]
28437#[derive(Debug, Clone, PartialEq)]
28438#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28439#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28440#[cfg_attr(feature = "ts", derive(TS))]
28441#[cfg_attr(feature = "ts", ts(export))]
28442pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
28443 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
28444 pub time_boot_ms: u32,
28445 #[doc = "Latitude in WGS84 frame"]
28446 pub lat_int: i32,
28447 #[doc = "Longitude in WGS84 frame"]
28448 pub lon_int: i32,
28449 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
28450 pub alt: f32,
28451 #[doc = "X velocity in NED frame"]
28452 pub vx: f32,
28453 #[doc = "Y velocity in NED frame"]
28454 pub vy: f32,
28455 #[doc = "Z velocity in NED frame"]
28456 pub vz: f32,
28457 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28458 pub afx: f32,
28459 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28460 pub afy: f32,
28461 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28462 pub afz: f32,
28463 #[doc = "yaw setpoint"]
28464 pub yaw: f32,
28465 #[doc = "yaw rate setpoint"]
28466 pub yaw_rate: f32,
28467 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28468 pub type_mask: PositionTargetTypemask,
28469 #[doc = "System ID"]
28470 pub target_system: u8,
28471 #[doc = "Component ID"]
28472 pub target_component: u8,
28473 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
28474 pub coordinate_frame: MavFrame,
28475}
28476impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
28477 pub const ENCODED_LEN: usize = 53usize;
28478 pub const DEFAULT: Self = Self {
28479 time_boot_ms: 0_u32,
28480 lat_int: 0_i32,
28481 lon_int: 0_i32,
28482 alt: 0.0_f32,
28483 vx: 0.0_f32,
28484 vy: 0.0_f32,
28485 vz: 0.0_f32,
28486 afx: 0.0_f32,
28487 afy: 0.0_f32,
28488 afz: 0.0_f32,
28489 yaw: 0.0_f32,
28490 yaw_rate: 0.0_f32,
28491 type_mask: PositionTargetTypemask::DEFAULT,
28492 target_system: 0_u8,
28493 target_component: 0_u8,
28494 coordinate_frame: MavFrame::DEFAULT,
28495 };
28496 #[cfg(feature = "arbitrary")]
28497 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28498 use arbitrary::{Arbitrary, Unstructured};
28499 let mut buf = [0u8; 1024];
28500 rng.fill_bytes(&mut buf);
28501 let mut unstructured = Unstructured::new(&buf);
28502 Self::arbitrary(&mut unstructured).unwrap_or_default()
28503 }
28504}
28505impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28506 fn default() -> Self {
28507 Self::DEFAULT.clone()
28508 }
28509}
28510impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28511 type Message = MavMessage;
28512 const ID: u32 = 86u32;
28513 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
28514 const EXTRA_CRC: u8 = 5u8;
28515 const ENCODED_LEN: usize = 53usize;
28516 fn deser(
28517 _version: MavlinkVersion,
28518 __input: &[u8],
28519 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28520 let avail_len = __input.len();
28521 let mut payload_buf = [0; Self::ENCODED_LEN];
28522 let mut buf = if avail_len < Self::ENCODED_LEN {
28523 payload_buf[0..avail_len].copy_from_slice(__input);
28524 Bytes::new(&payload_buf)
28525 } else {
28526 Bytes::new(__input)
28527 };
28528 let mut __struct = Self::default();
28529 __struct.time_boot_ms = buf.get_u32_le();
28530 __struct.lat_int = buf.get_i32_le();
28531 __struct.lon_int = buf.get_i32_le();
28532 __struct.alt = buf.get_f32_le();
28533 __struct.vx = buf.get_f32_le();
28534 __struct.vy = buf.get_f32_le();
28535 __struct.vz = buf.get_f32_le();
28536 __struct.afx = buf.get_f32_le();
28537 __struct.afy = buf.get_f32_le();
28538 __struct.afz = buf.get_f32_le();
28539 __struct.yaw = buf.get_f32_le();
28540 __struct.yaw_rate = buf.get_f32_le();
28541 let tmp = buf.get_u16_le();
28542 __struct.type_mask =
28543 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
28544 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28545 flag_type: "PositionTargetTypemask",
28546 value: tmp as u64,
28547 })?;
28548 __struct.target_system = buf.get_u8();
28549 __struct.target_component = buf.get_u8();
28550 let tmp = buf.get_u8();
28551 __struct.coordinate_frame =
28552 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28553 enum_type: "MavFrame",
28554 value: tmp as u64,
28555 })?;
28556 Ok(__struct)
28557 }
28558 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28559 let mut __tmp = BytesMut::new(bytes);
28560 #[allow(clippy::absurd_extreme_comparisons)]
28561 #[allow(unused_comparisons)]
28562 if __tmp.remaining() < Self::ENCODED_LEN {
28563 panic!(
28564 "buffer is too small (need {} bytes, but got {})",
28565 Self::ENCODED_LEN,
28566 __tmp.remaining(),
28567 )
28568 }
28569 __tmp.put_u32_le(self.time_boot_ms);
28570 __tmp.put_i32_le(self.lat_int);
28571 __tmp.put_i32_le(self.lon_int);
28572 __tmp.put_f32_le(self.alt);
28573 __tmp.put_f32_le(self.vx);
28574 __tmp.put_f32_le(self.vy);
28575 __tmp.put_f32_le(self.vz);
28576 __tmp.put_f32_le(self.afx);
28577 __tmp.put_f32_le(self.afy);
28578 __tmp.put_f32_le(self.afz);
28579 __tmp.put_f32_le(self.yaw);
28580 __tmp.put_f32_le(self.yaw_rate);
28581 __tmp.put_u16_le(self.type_mask.bits() as u16);
28582 __tmp.put_u8(self.target_system);
28583 __tmp.put_u8(self.target_component);
28584 __tmp.put_u8(self.coordinate_frame as u8);
28585 if matches!(version, MavlinkVersion::V2) {
28586 let len = __tmp.len();
28587 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28588 } else {
28589 __tmp.len()
28590 }
28591 }
28592}
28593#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
28594#[doc = ""]
28595#[doc = "ID: 84"]
28596#[derive(Debug, Clone, PartialEq)]
28597#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28598#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28599#[cfg_attr(feature = "ts", derive(TS))]
28600#[cfg_attr(feature = "ts", ts(export))]
28601pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
28602 #[doc = "Timestamp (time since system boot)."]
28603 pub time_boot_ms: u32,
28604 #[doc = "X Position in NED frame"]
28605 pub x: f32,
28606 #[doc = "Y Position in NED frame"]
28607 pub y: f32,
28608 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
28609 pub z: f32,
28610 #[doc = "X velocity in NED frame"]
28611 pub vx: f32,
28612 #[doc = "Y velocity in NED frame"]
28613 pub vy: f32,
28614 #[doc = "Z velocity in NED frame"]
28615 pub vz: f32,
28616 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28617 pub afx: f32,
28618 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28619 pub afy: f32,
28620 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28621 pub afz: f32,
28622 #[doc = "yaw setpoint"]
28623 pub yaw: f32,
28624 #[doc = "yaw rate setpoint"]
28625 pub yaw_rate: f32,
28626 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28627 pub type_mask: PositionTargetTypemask,
28628 #[doc = "System ID"]
28629 pub target_system: u8,
28630 #[doc = "Component ID"]
28631 pub target_component: u8,
28632 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
28633 pub coordinate_frame: MavFrame,
28634}
28635impl SET_POSITION_TARGET_LOCAL_NED_DATA {
28636 pub const ENCODED_LEN: usize = 53usize;
28637 pub const DEFAULT: Self = Self {
28638 time_boot_ms: 0_u32,
28639 x: 0.0_f32,
28640 y: 0.0_f32,
28641 z: 0.0_f32,
28642 vx: 0.0_f32,
28643 vy: 0.0_f32,
28644 vz: 0.0_f32,
28645 afx: 0.0_f32,
28646 afy: 0.0_f32,
28647 afz: 0.0_f32,
28648 yaw: 0.0_f32,
28649 yaw_rate: 0.0_f32,
28650 type_mask: PositionTargetTypemask::DEFAULT,
28651 target_system: 0_u8,
28652 target_component: 0_u8,
28653 coordinate_frame: MavFrame::DEFAULT,
28654 };
28655 #[cfg(feature = "arbitrary")]
28656 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28657 use arbitrary::{Arbitrary, Unstructured};
28658 let mut buf = [0u8; 1024];
28659 rng.fill_bytes(&mut buf);
28660 let mut unstructured = Unstructured::new(&buf);
28661 Self::arbitrary(&mut unstructured).unwrap_or_default()
28662 }
28663}
28664impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
28665 fn default() -> Self {
28666 Self::DEFAULT.clone()
28667 }
28668}
28669impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
28670 type Message = MavMessage;
28671 const ID: u32 = 84u32;
28672 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
28673 const EXTRA_CRC: u8 = 143u8;
28674 const ENCODED_LEN: usize = 53usize;
28675 fn deser(
28676 _version: MavlinkVersion,
28677 __input: &[u8],
28678 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28679 let avail_len = __input.len();
28680 let mut payload_buf = [0; Self::ENCODED_LEN];
28681 let mut buf = if avail_len < Self::ENCODED_LEN {
28682 payload_buf[0..avail_len].copy_from_slice(__input);
28683 Bytes::new(&payload_buf)
28684 } else {
28685 Bytes::new(__input)
28686 };
28687 let mut __struct = Self::default();
28688 __struct.time_boot_ms = buf.get_u32_le();
28689 __struct.x = buf.get_f32_le();
28690 __struct.y = buf.get_f32_le();
28691 __struct.z = buf.get_f32_le();
28692 __struct.vx = buf.get_f32_le();
28693 __struct.vy = buf.get_f32_le();
28694 __struct.vz = buf.get_f32_le();
28695 __struct.afx = buf.get_f32_le();
28696 __struct.afy = buf.get_f32_le();
28697 __struct.afz = buf.get_f32_le();
28698 __struct.yaw = buf.get_f32_le();
28699 __struct.yaw_rate = buf.get_f32_le();
28700 let tmp = buf.get_u16_le();
28701 __struct.type_mask =
28702 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
28703 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28704 flag_type: "PositionTargetTypemask",
28705 value: tmp as u64,
28706 })?;
28707 __struct.target_system = buf.get_u8();
28708 __struct.target_component = buf.get_u8();
28709 let tmp = buf.get_u8();
28710 __struct.coordinate_frame =
28711 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28712 enum_type: "MavFrame",
28713 value: tmp as u64,
28714 })?;
28715 Ok(__struct)
28716 }
28717 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28718 let mut __tmp = BytesMut::new(bytes);
28719 #[allow(clippy::absurd_extreme_comparisons)]
28720 #[allow(unused_comparisons)]
28721 if __tmp.remaining() < Self::ENCODED_LEN {
28722 panic!(
28723 "buffer is too small (need {} bytes, but got {})",
28724 Self::ENCODED_LEN,
28725 __tmp.remaining(),
28726 )
28727 }
28728 __tmp.put_u32_le(self.time_boot_ms);
28729 __tmp.put_f32_le(self.x);
28730 __tmp.put_f32_le(self.y);
28731 __tmp.put_f32_le(self.z);
28732 __tmp.put_f32_le(self.vx);
28733 __tmp.put_f32_le(self.vy);
28734 __tmp.put_f32_le(self.vz);
28735 __tmp.put_f32_le(self.afx);
28736 __tmp.put_f32_le(self.afy);
28737 __tmp.put_f32_le(self.afz);
28738 __tmp.put_f32_le(self.yaw);
28739 __tmp.put_f32_le(self.yaw_rate);
28740 __tmp.put_u16_le(self.type_mask.bits() as u16);
28741 __tmp.put_u8(self.target_system);
28742 __tmp.put_u8(self.target_component);
28743 __tmp.put_u8(self.coordinate_frame as u8);
28744 if matches!(version, MavlinkVersion::V2) {
28745 let len = __tmp.len();
28746 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28747 } else {
28748 __tmp.len()
28749 }
28750 }
28751}
28752#[doc = "Status of simulation environment, if used."]
28753#[doc = ""]
28754#[doc = "ID: 108"]
28755#[derive(Debug, Clone, PartialEq)]
28756#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28757#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28758#[cfg_attr(feature = "ts", derive(TS))]
28759#[cfg_attr(feature = "ts", ts(export))]
28760pub struct SIM_STATE_DATA {
28761 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
28762 pub q1: f32,
28763 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
28764 pub q2: f32,
28765 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
28766 pub q3: f32,
28767 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
28768 pub q4: f32,
28769 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
28770 pub roll: f32,
28771 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
28772 pub pitch: f32,
28773 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
28774 pub yaw: f32,
28775 #[doc = "X acceleration"]
28776 pub xacc: f32,
28777 #[doc = "Y acceleration"]
28778 pub yacc: f32,
28779 #[doc = "Z acceleration"]
28780 pub zacc: f32,
28781 #[doc = "Angular speed around X axis"]
28782 pub xgyro: f32,
28783 #[doc = "Angular speed around Y axis"]
28784 pub ygyro: f32,
28785 #[doc = "Angular speed around Z axis"]
28786 pub zgyro: f32,
28787 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
28788 pub lat: f32,
28789 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
28790 pub lon: f32,
28791 #[doc = "Altitude"]
28792 pub alt: f32,
28793 #[doc = "Horizontal position standard deviation"]
28794 pub std_dev_horz: f32,
28795 #[doc = "Vertical position standard deviation"]
28796 pub std_dev_vert: f32,
28797 #[doc = "True velocity in north direction in earth-fixed NED frame"]
28798 pub vn: f32,
28799 #[doc = "True velocity in east direction in earth-fixed NED frame"]
28800 pub ve: f32,
28801 #[doc = "True velocity in down direction in earth-fixed NED frame"]
28802 pub vd: f32,
28803 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
28804 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28805 pub lat_int: i32,
28806 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
28807 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28808 pub lon_int: i32,
28809}
28810impl SIM_STATE_DATA {
28811 pub const ENCODED_LEN: usize = 92usize;
28812 pub const DEFAULT: Self = Self {
28813 q1: 0.0_f32,
28814 q2: 0.0_f32,
28815 q3: 0.0_f32,
28816 q4: 0.0_f32,
28817 roll: 0.0_f32,
28818 pitch: 0.0_f32,
28819 yaw: 0.0_f32,
28820 xacc: 0.0_f32,
28821 yacc: 0.0_f32,
28822 zacc: 0.0_f32,
28823 xgyro: 0.0_f32,
28824 ygyro: 0.0_f32,
28825 zgyro: 0.0_f32,
28826 lat: 0.0_f32,
28827 lon: 0.0_f32,
28828 alt: 0.0_f32,
28829 std_dev_horz: 0.0_f32,
28830 std_dev_vert: 0.0_f32,
28831 vn: 0.0_f32,
28832 ve: 0.0_f32,
28833 vd: 0.0_f32,
28834 lat_int: 0_i32,
28835 lon_int: 0_i32,
28836 };
28837 #[cfg(feature = "arbitrary")]
28838 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28839 use arbitrary::{Arbitrary, Unstructured};
28840 let mut buf = [0u8; 1024];
28841 rng.fill_bytes(&mut buf);
28842 let mut unstructured = Unstructured::new(&buf);
28843 Self::arbitrary(&mut unstructured).unwrap_or_default()
28844 }
28845}
28846impl Default for SIM_STATE_DATA {
28847 fn default() -> Self {
28848 Self::DEFAULT.clone()
28849 }
28850}
28851impl MessageData for SIM_STATE_DATA {
28852 type Message = MavMessage;
28853 const ID: u32 = 108u32;
28854 const NAME: &'static str = "SIM_STATE";
28855 const EXTRA_CRC: u8 = 32u8;
28856 const ENCODED_LEN: usize = 92usize;
28857 fn deser(
28858 _version: MavlinkVersion,
28859 __input: &[u8],
28860 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28861 let avail_len = __input.len();
28862 let mut payload_buf = [0; Self::ENCODED_LEN];
28863 let mut buf = if avail_len < Self::ENCODED_LEN {
28864 payload_buf[0..avail_len].copy_from_slice(__input);
28865 Bytes::new(&payload_buf)
28866 } else {
28867 Bytes::new(__input)
28868 };
28869 let mut __struct = Self::default();
28870 __struct.q1 = buf.get_f32_le();
28871 __struct.q2 = buf.get_f32_le();
28872 __struct.q3 = buf.get_f32_le();
28873 __struct.q4 = buf.get_f32_le();
28874 __struct.roll = buf.get_f32_le();
28875 __struct.pitch = buf.get_f32_le();
28876 __struct.yaw = buf.get_f32_le();
28877 __struct.xacc = buf.get_f32_le();
28878 __struct.yacc = buf.get_f32_le();
28879 __struct.zacc = buf.get_f32_le();
28880 __struct.xgyro = buf.get_f32_le();
28881 __struct.ygyro = buf.get_f32_le();
28882 __struct.zgyro = buf.get_f32_le();
28883 __struct.lat = buf.get_f32_le();
28884 __struct.lon = buf.get_f32_le();
28885 __struct.alt = buf.get_f32_le();
28886 __struct.std_dev_horz = buf.get_f32_le();
28887 __struct.std_dev_vert = buf.get_f32_le();
28888 __struct.vn = buf.get_f32_le();
28889 __struct.ve = buf.get_f32_le();
28890 __struct.vd = buf.get_f32_le();
28891 __struct.lat_int = buf.get_i32_le();
28892 __struct.lon_int = buf.get_i32_le();
28893 Ok(__struct)
28894 }
28895 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28896 let mut __tmp = BytesMut::new(bytes);
28897 #[allow(clippy::absurd_extreme_comparisons)]
28898 #[allow(unused_comparisons)]
28899 if __tmp.remaining() < Self::ENCODED_LEN {
28900 panic!(
28901 "buffer is too small (need {} bytes, but got {})",
28902 Self::ENCODED_LEN,
28903 __tmp.remaining(),
28904 )
28905 }
28906 __tmp.put_f32_le(self.q1);
28907 __tmp.put_f32_le(self.q2);
28908 __tmp.put_f32_le(self.q3);
28909 __tmp.put_f32_le(self.q4);
28910 __tmp.put_f32_le(self.roll);
28911 __tmp.put_f32_le(self.pitch);
28912 __tmp.put_f32_le(self.yaw);
28913 __tmp.put_f32_le(self.xacc);
28914 __tmp.put_f32_le(self.yacc);
28915 __tmp.put_f32_le(self.zacc);
28916 __tmp.put_f32_le(self.xgyro);
28917 __tmp.put_f32_le(self.ygyro);
28918 __tmp.put_f32_le(self.zgyro);
28919 __tmp.put_f32_le(self.lat);
28920 __tmp.put_f32_le(self.lon);
28921 __tmp.put_f32_le(self.alt);
28922 __tmp.put_f32_le(self.std_dev_horz);
28923 __tmp.put_f32_le(self.std_dev_vert);
28924 __tmp.put_f32_le(self.vn);
28925 __tmp.put_f32_le(self.ve);
28926 __tmp.put_f32_le(self.vd);
28927 if matches!(version, MavlinkVersion::V2) {
28928 __tmp.put_i32_le(self.lat_int);
28929 __tmp.put_i32_le(self.lon_int);
28930 let len = __tmp.len();
28931 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28932 } else {
28933 __tmp.len()
28934 }
28935 }
28936}
28937#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
28938#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
28939#[doc = ""]
28940#[doc = "ID: 370"]
28941#[derive(Debug, Clone, PartialEq)]
28942#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28943#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28944#[cfg_attr(feature = "ts", derive(TS))]
28945#[cfg_attr(feature = "ts", ts(export))]
28946pub struct SMART_BATTERY_INFO_DATA {
28947 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
28948 pub capacity_full_specification: i32,
28949 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
28950 pub capacity_full: i32,
28951 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
28952 pub cycle_count: u16,
28953 #[doc = "Battery weight. 0: field not provided."]
28954 pub weight: u16,
28955 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
28956 pub discharge_minimum_voltage: u16,
28957 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
28958 pub charging_minimum_voltage: u16,
28959 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
28960 pub resting_minimum_voltage: u16,
28961 #[doc = "Battery ID"]
28962 pub id: u8,
28963 #[doc = "Function of the battery"]
28964 pub battery_function: MavBatteryFunction,
28965 #[doc = "Type (chemistry) of the battery"]
28966 pub mavtype: MavBatteryType,
28967 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
28968 #[cfg_attr(feature = "ts", ts(type = "string"))]
28969 pub serial_number: CharArray<16>,
28970 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
28971 #[cfg_attr(feature = "ts", ts(type = "string"))]
28972 pub device_name: CharArray<50>,
28973 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
28974 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28975 pub charging_maximum_voltage: u16,
28976 #[doc = "Number of battery cells in series. 0: field not provided."]
28977 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28978 pub cells_in_series: u8,
28979 #[doc = "Maximum pack discharge current. 0: field not provided."]
28980 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28981 pub discharge_maximum_current: u32,
28982 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
28983 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28984 pub discharge_maximum_burst_current: u32,
28985 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
28986 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28987 #[cfg_attr(feature = "ts", ts(type = "string"))]
28988 pub manufacture_date: CharArray<11>,
28989}
28990impl SMART_BATTERY_INFO_DATA {
28991 pub const ENCODED_LEN: usize = 109usize;
28992 pub const DEFAULT: Self = Self {
28993 capacity_full_specification: 0_i32,
28994 capacity_full: 0_i32,
28995 cycle_count: 0_u16,
28996 weight: 0_u16,
28997 discharge_minimum_voltage: 0_u16,
28998 charging_minimum_voltage: 0_u16,
28999 resting_minimum_voltage: 0_u16,
29000 id: 0_u8,
29001 battery_function: MavBatteryFunction::DEFAULT,
29002 mavtype: MavBatteryType::DEFAULT,
29003 serial_number: CharArray::new([0_u8; 16usize]),
29004 device_name: CharArray::new([0_u8; 50usize]),
29005 charging_maximum_voltage: 0_u16,
29006 cells_in_series: 0_u8,
29007 discharge_maximum_current: 0_u32,
29008 discharge_maximum_burst_current: 0_u32,
29009 manufacture_date: CharArray::new([0_u8; 11usize]),
29010 };
29011 #[cfg(feature = "arbitrary")]
29012 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29013 use arbitrary::{Arbitrary, Unstructured};
29014 let mut buf = [0u8; 1024];
29015 rng.fill_bytes(&mut buf);
29016 let mut unstructured = Unstructured::new(&buf);
29017 Self::arbitrary(&mut unstructured).unwrap_or_default()
29018 }
29019}
29020impl Default for SMART_BATTERY_INFO_DATA {
29021 fn default() -> Self {
29022 Self::DEFAULT.clone()
29023 }
29024}
29025impl MessageData for SMART_BATTERY_INFO_DATA {
29026 type Message = MavMessage;
29027 const ID: u32 = 370u32;
29028 const NAME: &'static str = "SMART_BATTERY_INFO";
29029 const EXTRA_CRC: u8 = 75u8;
29030 const ENCODED_LEN: usize = 109usize;
29031 fn deser(
29032 _version: MavlinkVersion,
29033 __input: &[u8],
29034 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29035 let avail_len = __input.len();
29036 let mut payload_buf = [0; Self::ENCODED_LEN];
29037 let mut buf = if avail_len < Self::ENCODED_LEN {
29038 payload_buf[0..avail_len].copy_from_slice(__input);
29039 Bytes::new(&payload_buf)
29040 } else {
29041 Bytes::new(__input)
29042 };
29043 let mut __struct = Self::default();
29044 __struct.capacity_full_specification = buf.get_i32_le();
29045 __struct.capacity_full = buf.get_i32_le();
29046 __struct.cycle_count = buf.get_u16_le();
29047 __struct.weight = buf.get_u16_le();
29048 __struct.discharge_minimum_voltage = buf.get_u16_le();
29049 __struct.charging_minimum_voltage = buf.get_u16_le();
29050 __struct.resting_minimum_voltage = buf.get_u16_le();
29051 __struct.id = buf.get_u8();
29052 let tmp = buf.get_u8();
29053 __struct.battery_function =
29054 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29055 enum_type: "MavBatteryFunction",
29056 value: tmp as u64,
29057 })?;
29058 let tmp = buf.get_u8();
29059 __struct.mavtype =
29060 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29061 enum_type: "MavBatteryType",
29062 value: tmp as u64,
29063 })?;
29064 let mut tmp = [0_u8; 16usize];
29065 for v in &mut tmp {
29066 *v = buf.get_u8();
29067 }
29068 __struct.serial_number = CharArray::new(tmp);
29069 let mut tmp = [0_u8; 50usize];
29070 for v in &mut tmp {
29071 *v = buf.get_u8();
29072 }
29073 __struct.device_name = CharArray::new(tmp);
29074 __struct.charging_maximum_voltage = buf.get_u16_le();
29075 __struct.cells_in_series = buf.get_u8();
29076 __struct.discharge_maximum_current = buf.get_u32_le();
29077 __struct.discharge_maximum_burst_current = buf.get_u32_le();
29078 let mut tmp = [0_u8; 11usize];
29079 for v in &mut tmp {
29080 *v = buf.get_u8();
29081 }
29082 __struct.manufacture_date = CharArray::new(tmp);
29083 Ok(__struct)
29084 }
29085 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29086 let mut __tmp = BytesMut::new(bytes);
29087 #[allow(clippy::absurd_extreme_comparisons)]
29088 #[allow(unused_comparisons)]
29089 if __tmp.remaining() < Self::ENCODED_LEN {
29090 panic!(
29091 "buffer is too small (need {} bytes, but got {})",
29092 Self::ENCODED_LEN,
29093 __tmp.remaining(),
29094 )
29095 }
29096 __tmp.put_i32_le(self.capacity_full_specification);
29097 __tmp.put_i32_le(self.capacity_full);
29098 __tmp.put_u16_le(self.cycle_count);
29099 __tmp.put_u16_le(self.weight);
29100 __tmp.put_u16_le(self.discharge_minimum_voltage);
29101 __tmp.put_u16_le(self.charging_minimum_voltage);
29102 __tmp.put_u16_le(self.resting_minimum_voltage);
29103 __tmp.put_u8(self.id);
29104 __tmp.put_u8(self.battery_function as u8);
29105 __tmp.put_u8(self.mavtype as u8);
29106 for val in &self.serial_number {
29107 __tmp.put_u8(*val);
29108 }
29109 for val in &self.device_name {
29110 __tmp.put_u8(*val);
29111 }
29112 if matches!(version, MavlinkVersion::V2) {
29113 __tmp.put_u16_le(self.charging_maximum_voltage);
29114 __tmp.put_u8(self.cells_in_series);
29115 __tmp.put_u32_le(self.discharge_maximum_current);
29116 __tmp.put_u32_le(self.discharge_maximum_burst_current);
29117 for val in &self.manufacture_date {
29118 __tmp.put_u8(*val);
29119 }
29120 let len = __tmp.len();
29121 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29122 } else {
29123 __tmp.len()
29124 }
29125 }
29126}
29127#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
29128#[doc = ""]
29129#[doc = "ID: 253"]
29130#[derive(Debug, Clone, PartialEq)]
29131#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29133#[cfg_attr(feature = "ts", derive(TS))]
29134#[cfg_attr(feature = "ts", ts(export))]
29135pub struct STATUSTEXT_DATA {
29136 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
29137 pub severity: MavSeverity,
29138 #[doc = "Status text message, without null termination character"]
29139 #[cfg_attr(feature = "ts", ts(type = "string"))]
29140 pub text: CharArray<50>,
29141 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
29142 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29143 pub id: u16,
29144 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
29145 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29146 pub chunk_seq: u8,
29147}
29148impl STATUSTEXT_DATA {
29149 pub const ENCODED_LEN: usize = 54usize;
29150 pub const DEFAULT: Self = Self {
29151 severity: MavSeverity::DEFAULT,
29152 text: CharArray::new([0_u8; 50usize]),
29153 id: 0_u16,
29154 chunk_seq: 0_u8,
29155 };
29156 #[cfg(feature = "arbitrary")]
29157 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29158 use arbitrary::{Arbitrary, Unstructured};
29159 let mut buf = [0u8; 1024];
29160 rng.fill_bytes(&mut buf);
29161 let mut unstructured = Unstructured::new(&buf);
29162 Self::arbitrary(&mut unstructured).unwrap_or_default()
29163 }
29164}
29165impl Default for STATUSTEXT_DATA {
29166 fn default() -> Self {
29167 Self::DEFAULT.clone()
29168 }
29169}
29170impl MessageData for STATUSTEXT_DATA {
29171 type Message = MavMessage;
29172 const ID: u32 = 253u32;
29173 const NAME: &'static str = "STATUSTEXT";
29174 const EXTRA_CRC: u8 = 83u8;
29175 const ENCODED_LEN: usize = 54usize;
29176 fn deser(
29177 _version: MavlinkVersion,
29178 __input: &[u8],
29179 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29180 let avail_len = __input.len();
29181 let mut payload_buf = [0; Self::ENCODED_LEN];
29182 let mut buf = if avail_len < Self::ENCODED_LEN {
29183 payload_buf[0..avail_len].copy_from_slice(__input);
29184 Bytes::new(&payload_buf)
29185 } else {
29186 Bytes::new(__input)
29187 };
29188 let mut __struct = Self::default();
29189 let tmp = buf.get_u8();
29190 __struct.severity =
29191 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29192 enum_type: "MavSeverity",
29193 value: tmp as u64,
29194 })?;
29195 let mut tmp = [0_u8; 50usize];
29196 for v in &mut tmp {
29197 *v = buf.get_u8();
29198 }
29199 __struct.text = CharArray::new(tmp);
29200 __struct.id = buf.get_u16_le();
29201 __struct.chunk_seq = buf.get_u8();
29202 Ok(__struct)
29203 }
29204 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29205 let mut __tmp = BytesMut::new(bytes);
29206 #[allow(clippy::absurd_extreme_comparisons)]
29207 #[allow(unused_comparisons)]
29208 if __tmp.remaining() < Self::ENCODED_LEN {
29209 panic!(
29210 "buffer is too small (need {} bytes, but got {})",
29211 Self::ENCODED_LEN,
29212 __tmp.remaining(),
29213 )
29214 }
29215 __tmp.put_u8(self.severity as u8);
29216 for val in &self.text {
29217 __tmp.put_u8(*val);
29218 }
29219 if matches!(version, MavlinkVersion::V2) {
29220 __tmp.put_u16_le(self.id);
29221 __tmp.put_u8(self.chunk_seq);
29222 let len = __tmp.len();
29223 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29224 } else {
29225 __tmp.len()
29226 }
29227 }
29228}
29229#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
29230#[doc = ""]
29231#[doc = "ID: 261"]
29232#[derive(Debug, Clone, PartialEq)]
29233#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29234#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29235#[cfg_attr(feature = "ts", derive(TS))]
29236#[cfg_attr(feature = "ts", ts(export))]
29237pub struct STORAGE_INFORMATION_DATA {
29238 #[doc = "Timestamp (time since system boot)."]
29239 pub time_boot_ms: u32,
29240 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29241 pub total_capacity: f32,
29242 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29243 pub used_capacity: f32,
29244 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29245 pub available_capacity: f32,
29246 #[doc = "Read speed."]
29247 pub read_speed: f32,
29248 #[doc = "Write speed."]
29249 pub write_speed: f32,
29250 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
29251 pub storage_id: u8,
29252 #[doc = "Number of storage devices"]
29253 pub storage_count: u8,
29254 #[doc = "Status of storage"]
29255 pub status: StorageStatus,
29256 #[doc = "Type of storage"]
29257 #[cfg_attr(feature = "serde", serde(default))]
29258 pub mavtype: StorageType,
29259 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
29260 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29261 #[cfg_attr(feature = "ts", ts(type = "string"))]
29262 pub name: CharArray<32>,
29263 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
29264 #[cfg_attr(feature = "serde", serde(default))]
29265 pub storage_usage: StorageUsageFlag,
29266}
29267impl STORAGE_INFORMATION_DATA {
29268 pub const ENCODED_LEN: usize = 61usize;
29269 pub const DEFAULT: Self = Self {
29270 time_boot_ms: 0_u32,
29271 total_capacity: 0.0_f32,
29272 used_capacity: 0.0_f32,
29273 available_capacity: 0.0_f32,
29274 read_speed: 0.0_f32,
29275 write_speed: 0.0_f32,
29276 storage_id: 0_u8,
29277 storage_count: 0_u8,
29278 status: StorageStatus::DEFAULT,
29279 mavtype: StorageType::DEFAULT,
29280 name: CharArray::new([0_u8; 32usize]),
29281 storage_usage: StorageUsageFlag::DEFAULT,
29282 };
29283 #[cfg(feature = "arbitrary")]
29284 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29285 use arbitrary::{Arbitrary, Unstructured};
29286 let mut buf = [0u8; 1024];
29287 rng.fill_bytes(&mut buf);
29288 let mut unstructured = Unstructured::new(&buf);
29289 Self::arbitrary(&mut unstructured).unwrap_or_default()
29290 }
29291}
29292impl Default for STORAGE_INFORMATION_DATA {
29293 fn default() -> Self {
29294 Self::DEFAULT.clone()
29295 }
29296}
29297impl MessageData for STORAGE_INFORMATION_DATA {
29298 type Message = MavMessage;
29299 const ID: u32 = 261u32;
29300 const NAME: &'static str = "STORAGE_INFORMATION";
29301 const EXTRA_CRC: u8 = 179u8;
29302 const ENCODED_LEN: usize = 61usize;
29303 fn deser(
29304 _version: MavlinkVersion,
29305 __input: &[u8],
29306 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29307 let avail_len = __input.len();
29308 let mut payload_buf = [0; Self::ENCODED_LEN];
29309 let mut buf = if avail_len < Self::ENCODED_LEN {
29310 payload_buf[0..avail_len].copy_from_slice(__input);
29311 Bytes::new(&payload_buf)
29312 } else {
29313 Bytes::new(__input)
29314 };
29315 let mut __struct = Self::default();
29316 __struct.time_boot_ms = buf.get_u32_le();
29317 __struct.total_capacity = buf.get_f32_le();
29318 __struct.used_capacity = buf.get_f32_le();
29319 __struct.available_capacity = buf.get_f32_le();
29320 __struct.read_speed = buf.get_f32_le();
29321 __struct.write_speed = buf.get_f32_le();
29322 __struct.storage_id = buf.get_u8();
29323 __struct.storage_count = buf.get_u8();
29324 let tmp = buf.get_u8();
29325 __struct.status =
29326 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29327 enum_type: "StorageStatus",
29328 value: tmp as u64,
29329 })?;
29330 let tmp = buf.get_u8();
29331 __struct.mavtype =
29332 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29333 enum_type: "StorageType",
29334 value: tmp as u64,
29335 })?;
29336 let mut tmp = [0_u8; 32usize];
29337 for v in &mut tmp {
29338 *v = buf.get_u8();
29339 }
29340 __struct.name = CharArray::new(tmp);
29341 let tmp = buf.get_u8();
29342 __struct.storage_usage = StorageUsageFlag::from_bits(
29343 tmp as <StorageUsageFlag as Flags>::Bits,
29344 )
29345 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29346 flag_type: "StorageUsageFlag",
29347 value: tmp as u64,
29348 })?;
29349 Ok(__struct)
29350 }
29351 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29352 let mut __tmp = BytesMut::new(bytes);
29353 #[allow(clippy::absurd_extreme_comparisons)]
29354 #[allow(unused_comparisons)]
29355 if __tmp.remaining() < Self::ENCODED_LEN {
29356 panic!(
29357 "buffer is too small (need {} bytes, but got {})",
29358 Self::ENCODED_LEN,
29359 __tmp.remaining(),
29360 )
29361 }
29362 __tmp.put_u32_le(self.time_boot_ms);
29363 __tmp.put_f32_le(self.total_capacity);
29364 __tmp.put_f32_le(self.used_capacity);
29365 __tmp.put_f32_le(self.available_capacity);
29366 __tmp.put_f32_le(self.read_speed);
29367 __tmp.put_f32_le(self.write_speed);
29368 __tmp.put_u8(self.storage_id);
29369 __tmp.put_u8(self.storage_count);
29370 __tmp.put_u8(self.status as u8);
29371 if matches!(version, MavlinkVersion::V2) {
29372 __tmp.put_u8(self.mavtype as u8);
29373 for val in &self.name {
29374 __tmp.put_u8(*val);
29375 }
29376 __tmp.put_u8(self.storage_usage.bits() as u8);
29377 let len = __tmp.len();
29378 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29379 } else {
29380 __tmp.len()
29381 }
29382 }
29383}
29384#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
29385#[doc = ""]
29386#[doc = "ID: 401"]
29387#[derive(Debug, Clone, PartialEq)]
29388#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29389#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29390#[cfg_attr(feature = "ts", derive(TS))]
29391#[cfg_attr(feature = "ts", ts(export))]
29392pub struct SUPPORTED_TUNES_DATA {
29393 #[doc = "Bitfield of supported tune formats."]
29394 pub format: TuneFormat,
29395 #[doc = "System ID"]
29396 pub target_system: u8,
29397 #[doc = "Component ID"]
29398 pub target_component: u8,
29399}
29400impl SUPPORTED_TUNES_DATA {
29401 pub const ENCODED_LEN: usize = 6usize;
29402 pub const DEFAULT: Self = Self {
29403 format: TuneFormat::DEFAULT,
29404 target_system: 0_u8,
29405 target_component: 0_u8,
29406 };
29407 #[cfg(feature = "arbitrary")]
29408 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29409 use arbitrary::{Arbitrary, Unstructured};
29410 let mut buf = [0u8; 1024];
29411 rng.fill_bytes(&mut buf);
29412 let mut unstructured = Unstructured::new(&buf);
29413 Self::arbitrary(&mut unstructured).unwrap_or_default()
29414 }
29415}
29416impl Default for SUPPORTED_TUNES_DATA {
29417 fn default() -> Self {
29418 Self::DEFAULT.clone()
29419 }
29420}
29421impl MessageData for SUPPORTED_TUNES_DATA {
29422 type Message = MavMessage;
29423 const ID: u32 = 401u32;
29424 const NAME: &'static str = "SUPPORTED_TUNES";
29425 const EXTRA_CRC: u8 = 183u8;
29426 const ENCODED_LEN: usize = 6usize;
29427 fn deser(
29428 _version: MavlinkVersion,
29429 __input: &[u8],
29430 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29431 let avail_len = __input.len();
29432 let mut payload_buf = [0; Self::ENCODED_LEN];
29433 let mut buf = if avail_len < Self::ENCODED_LEN {
29434 payload_buf[0..avail_len].copy_from_slice(__input);
29435 Bytes::new(&payload_buf)
29436 } else {
29437 Bytes::new(__input)
29438 };
29439 let mut __struct = Self::default();
29440 let tmp = buf.get_u32_le();
29441 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
29442 ::mavlink_core::error::ParserError::InvalidEnum {
29443 enum_type: "TuneFormat",
29444 value: tmp as u64,
29445 },
29446 )?;
29447 __struct.target_system = buf.get_u8();
29448 __struct.target_component = buf.get_u8();
29449 Ok(__struct)
29450 }
29451 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29452 let mut __tmp = BytesMut::new(bytes);
29453 #[allow(clippy::absurd_extreme_comparisons)]
29454 #[allow(unused_comparisons)]
29455 if __tmp.remaining() < Self::ENCODED_LEN {
29456 panic!(
29457 "buffer is too small (need {} bytes, but got {})",
29458 Self::ENCODED_LEN,
29459 __tmp.remaining(),
29460 )
29461 }
29462 __tmp.put_u32_le(self.format as u32);
29463 __tmp.put_u8(self.target_system);
29464 __tmp.put_u8(self.target_component);
29465 if matches!(version, MavlinkVersion::V2) {
29466 let len = __tmp.len();
29467 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29468 } else {
29469 __tmp.len()
29470 }
29471 }
29472}
29473#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
29474#[doc = ""]
29475#[doc = "ID: 2"]
29476#[derive(Debug, Clone, PartialEq)]
29477#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29479#[cfg_attr(feature = "ts", derive(TS))]
29480#[cfg_attr(feature = "ts", ts(export))]
29481pub struct SYSTEM_TIME_DATA {
29482 #[doc = "Timestamp (UNIX epoch time)."]
29483 pub time_unix_usec: u64,
29484 #[doc = "Timestamp (time since system boot)."]
29485 pub time_boot_ms: u32,
29486}
29487impl SYSTEM_TIME_DATA {
29488 pub const ENCODED_LEN: usize = 12usize;
29489 pub const DEFAULT: Self = Self {
29490 time_unix_usec: 0_u64,
29491 time_boot_ms: 0_u32,
29492 };
29493 #[cfg(feature = "arbitrary")]
29494 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29495 use arbitrary::{Arbitrary, Unstructured};
29496 let mut buf = [0u8; 1024];
29497 rng.fill_bytes(&mut buf);
29498 let mut unstructured = Unstructured::new(&buf);
29499 Self::arbitrary(&mut unstructured).unwrap_or_default()
29500 }
29501}
29502impl Default for SYSTEM_TIME_DATA {
29503 fn default() -> Self {
29504 Self::DEFAULT.clone()
29505 }
29506}
29507impl MessageData for SYSTEM_TIME_DATA {
29508 type Message = MavMessage;
29509 const ID: u32 = 2u32;
29510 const NAME: &'static str = "SYSTEM_TIME";
29511 const EXTRA_CRC: u8 = 137u8;
29512 const ENCODED_LEN: usize = 12usize;
29513 fn deser(
29514 _version: MavlinkVersion,
29515 __input: &[u8],
29516 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29517 let avail_len = __input.len();
29518 let mut payload_buf = [0; Self::ENCODED_LEN];
29519 let mut buf = if avail_len < Self::ENCODED_LEN {
29520 payload_buf[0..avail_len].copy_from_slice(__input);
29521 Bytes::new(&payload_buf)
29522 } else {
29523 Bytes::new(__input)
29524 };
29525 let mut __struct = Self::default();
29526 __struct.time_unix_usec = buf.get_u64_le();
29527 __struct.time_boot_ms = buf.get_u32_le();
29528 Ok(__struct)
29529 }
29530 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29531 let mut __tmp = BytesMut::new(bytes);
29532 #[allow(clippy::absurd_extreme_comparisons)]
29533 #[allow(unused_comparisons)]
29534 if __tmp.remaining() < Self::ENCODED_LEN {
29535 panic!(
29536 "buffer is too small (need {} bytes, but got {})",
29537 Self::ENCODED_LEN,
29538 __tmp.remaining(),
29539 )
29540 }
29541 __tmp.put_u64_le(self.time_unix_usec);
29542 __tmp.put_u32_le(self.time_boot_ms);
29543 if matches!(version, MavlinkVersion::V2) {
29544 let len = __tmp.len();
29545 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29546 } else {
29547 __tmp.len()
29548 }
29549 }
29550}
29551#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
29552#[doc = ""]
29553#[doc = "ID: 1"]
29554#[derive(Debug, Clone, PartialEq)]
29555#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29556#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29557#[cfg_attr(feature = "ts", derive(TS))]
29558#[cfg_attr(feature = "ts", ts(export))]
29559pub struct SYS_STATUS_DATA {
29560 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29561 pub onboard_control_sensors_present: MavSysStatusSensor,
29562 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29563 pub onboard_control_sensors_enabled: MavSysStatusSensor,
29564 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29565 pub onboard_control_sensors_health: MavSysStatusSensor,
29566 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
29567 pub load: u16,
29568 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
29569 pub voltage_battery: u16,
29570 #[doc = "Battery current, -1: Current not sent by autopilot"]
29571 pub current_battery: i16,
29572 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29573 pub drop_rate_comm: u16,
29574 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29575 pub errors_comm: u16,
29576 #[doc = "Autopilot-specific errors"]
29577 pub errors_count1: u16,
29578 #[doc = "Autopilot-specific errors"]
29579 pub errors_count2: u16,
29580 #[doc = "Autopilot-specific errors"]
29581 pub errors_count3: u16,
29582 #[doc = "Autopilot-specific errors"]
29583 pub errors_count4: u16,
29584 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
29585 pub battery_remaining: i8,
29586 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29587 #[cfg_attr(feature = "serde", serde(default))]
29588 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
29589 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29590 #[cfg_attr(feature = "serde", serde(default))]
29591 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
29592 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29593 #[cfg_attr(feature = "serde", serde(default))]
29594 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
29595}
29596impl SYS_STATUS_DATA {
29597 pub const ENCODED_LEN: usize = 43usize;
29598 pub const DEFAULT: Self = Self {
29599 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
29600 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
29601 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
29602 load: 0_u16,
29603 voltage_battery: 0_u16,
29604 current_battery: 0_i16,
29605 drop_rate_comm: 0_u16,
29606 errors_comm: 0_u16,
29607 errors_count1: 0_u16,
29608 errors_count2: 0_u16,
29609 errors_count3: 0_u16,
29610 errors_count4: 0_u16,
29611 battery_remaining: 0_i8,
29612 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
29613 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
29614 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
29615 };
29616 #[cfg(feature = "arbitrary")]
29617 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29618 use arbitrary::{Arbitrary, Unstructured};
29619 let mut buf = [0u8; 1024];
29620 rng.fill_bytes(&mut buf);
29621 let mut unstructured = Unstructured::new(&buf);
29622 Self::arbitrary(&mut unstructured).unwrap_or_default()
29623 }
29624}
29625impl Default for SYS_STATUS_DATA {
29626 fn default() -> Self {
29627 Self::DEFAULT.clone()
29628 }
29629}
29630impl MessageData for SYS_STATUS_DATA {
29631 type Message = MavMessage;
29632 const ID: u32 = 1u32;
29633 const NAME: &'static str = "SYS_STATUS";
29634 const EXTRA_CRC: u8 = 124u8;
29635 const ENCODED_LEN: usize = 43usize;
29636 fn deser(
29637 _version: MavlinkVersion,
29638 __input: &[u8],
29639 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29640 let avail_len = __input.len();
29641 let mut payload_buf = [0; Self::ENCODED_LEN];
29642 let mut buf = if avail_len < Self::ENCODED_LEN {
29643 payload_buf[0..avail_len].copy_from_slice(__input);
29644 Bytes::new(&payload_buf)
29645 } else {
29646 Bytes::new(__input)
29647 };
29648 let mut __struct = Self::default();
29649 let tmp = buf.get_u32_le();
29650 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
29651 tmp as <MavSysStatusSensor as Flags>::Bits,
29652 )
29653 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29654 flag_type: "MavSysStatusSensor",
29655 value: tmp as u64,
29656 })?;
29657 let tmp = buf.get_u32_le();
29658 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
29659 tmp as <MavSysStatusSensor as Flags>::Bits,
29660 )
29661 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29662 flag_type: "MavSysStatusSensor",
29663 value: tmp as u64,
29664 })?;
29665 let tmp = buf.get_u32_le();
29666 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
29667 tmp as <MavSysStatusSensor as Flags>::Bits,
29668 )
29669 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29670 flag_type: "MavSysStatusSensor",
29671 value: tmp as u64,
29672 })?;
29673 __struct.load = buf.get_u16_le();
29674 __struct.voltage_battery = buf.get_u16_le();
29675 __struct.current_battery = buf.get_i16_le();
29676 __struct.drop_rate_comm = buf.get_u16_le();
29677 __struct.errors_comm = buf.get_u16_le();
29678 __struct.errors_count1 = buf.get_u16_le();
29679 __struct.errors_count2 = buf.get_u16_le();
29680 __struct.errors_count3 = buf.get_u16_le();
29681 __struct.errors_count4 = buf.get_u16_le();
29682 __struct.battery_remaining = buf.get_i8();
29683 let tmp = buf.get_u32_le();
29684 __struct.onboard_control_sensors_present_extended = MavSysStatusSensorExtended::from_bits(
29685 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
29686 )
29687 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29688 flag_type: "MavSysStatusSensorExtended",
29689 value: tmp as u64,
29690 })?;
29691 let tmp = buf.get_u32_le();
29692 __struct.onboard_control_sensors_enabled_extended = MavSysStatusSensorExtended::from_bits(
29693 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
29694 )
29695 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29696 flag_type: "MavSysStatusSensorExtended",
29697 value: tmp as u64,
29698 })?;
29699 let tmp = buf.get_u32_le();
29700 __struct.onboard_control_sensors_health_extended = MavSysStatusSensorExtended::from_bits(
29701 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
29702 )
29703 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29704 flag_type: "MavSysStatusSensorExtended",
29705 value: tmp as u64,
29706 })?;
29707 Ok(__struct)
29708 }
29709 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29710 let mut __tmp = BytesMut::new(bytes);
29711 #[allow(clippy::absurd_extreme_comparisons)]
29712 #[allow(unused_comparisons)]
29713 if __tmp.remaining() < Self::ENCODED_LEN {
29714 panic!(
29715 "buffer is too small (need {} bytes, but got {})",
29716 Self::ENCODED_LEN,
29717 __tmp.remaining(),
29718 )
29719 }
29720 __tmp.put_u32_le(self.onboard_control_sensors_present.bits() as u32);
29721 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits() as u32);
29722 __tmp.put_u32_le(self.onboard_control_sensors_health.bits() as u32);
29723 __tmp.put_u16_le(self.load);
29724 __tmp.put_u16_le(self.voltage_battery);
29725 __tmp.put_i16_le(self.current_battery);
29726 __tmp.put_u16_le(self.drop_rate_comm);
29727 __tmp.put_u16_le(self.errors_comm);
29728 __tmp.put_u16_le(self.errors_count1);
29729 __tmp.put_u16_le(self.errors_count2);
29730 __tmp.put_u16_le(self.errors_count3);
29731 __tmp.put_u16_le(self.errors_count4);
29732 __tmp.put_i8(self.battery_remaining);
29733 if matches!(version, MavlinkVersion::V2) {
29734 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits() as u32);
29735 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits() as u32);
29736 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits() as u32);
29737 let len = __tmp.len();
29738 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29739 } else {
29740 __tmp.len()
29741 }
29742 }
29743}
29744#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
29745#[doc = ""]
29746#[doc = "ID: 135"]
29747#[derive(Debug, Clone, PartialEq)]
29748#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29749#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29750#[cfg_attr(feature = "ts", derive(TS))]
29751#[cfg_attr(feature = "ts", ts(export))]
29752pub struct TERRAIN_CHECK_DATA {
29753 #[doc = "Latitude"]
29754 pub lat: i32,
29755 #[doc = "Longitude"]
29756 pub lon: i32,
29757}
29758impl TERRAIN_CHECK_DATA {
29759 pub const ENCODED_LEN: usize = 8usize;
29760 pub const DEFAULT: Self = Self {
29761 lat: 0_i32,
29762 lon: 0_i32,
29763 };
29764 #[cfg(feature = "arbitrary")]
29765 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29766 use arbitrary::{Arbitrary, Unstructured};
29767 let mut buf = [0u8; 1024];
29768 rng.fill_bytes(&mut buf);
29769 let mut unstructured = Unstructured::new(&buf);
29770 Self::arbitrary(&mut unstructured).unwrap_or_default()
29771 }
29772}
29773impl Default for TERRAIN_CHECK_DATA {
29774 fn default() -> Self {
29775 Self::DEFAULT.clone()
29776 }
29777}
29778impl MessageData for TERRAIN_CHECK_DATA {
29779 type Message = MavMessage;
29780 const ID: u32 = 135u32;
29781 const NAME: &'static str = "TERRAIN_CHECK";
29782 const EXTRA_CRC: u8 = 203u8;
29783 const ENCODED_LEN: usize = 8usize;
29784 fn deser(
29785 _version: MavlinkVersion,
29786 __input: &[u8],
29787 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29788 let avail_len = __input.len();
29789 let mut payload_buf = [0; Self::ENCODED_LEN];
29790 let mut buf = if avail_len < Self::ENCODED_LEN {
29791 payload_buf[0..avail_len].copy_from_slice(__input);
29792 Bytes::new(&payload_buf)
29793 } else {
29794 Bytes::new(__input)
29795 };
29796 let mut __struct = Self::default();
29797 __struct.lat = buf.get_i32_le();
29798 __struct.lon = buf.get_i32_le();
29799 Ok(__struct)
29800 }
29801 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29802 let mut __tmp = BytesMut::new(bytes);
29803 #[allow(clippy::absurd_extreme_comparisons)]
29804 #[allow(unused_comparisons)]
29805 if __tmp.remaining() < Self::ENCODED_LEN {
29806 panic!(
29807 "buffer is too small (need {} bytes, but got {})",
29808 Self::ENCODED_LEN,
29809 __tmp.remaining(),
29810 )
29811 }
29812 __tmp.put_i32_le(self.lat);
29813 __tmp.put_i32_le(self.lon);
29814 if matches!(version, MavlinkVersion::V2) {
29815 let len = __tmp.len();
29816 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29817 } else {
29818 __tmp.len()
29819 }
29820 }
29821}
29822#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29823#[doc = ""]
29824#[doc = "ID: 134"]
29825#[derive(Debug, Clone, PartialEq)]
29826#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29827#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29828#[cfg_attr(feature = "ts", derive(TS))]
29829#[cfg_attr(feature = "ts", ts(export))]
29830pub struct TERRAIN_DATA_DATA {
29831 #[doc = "Latitude of SW corner of first grid"]
29832 pub lat: i32,
29833 #[doc = "Longitude of SW corner of first grid"]
29834 pub lon: i32,
29835 #[doc = "Grid spacing"]
29836 pub grid_spacing: u16,
29837 #[doc = "Terrain data MSL"]
29838 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29839 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29840 pub data: [i16; 16],
29841 #[doc = "bit within the terrain request mask"]
29842 pub gridbit: u8,
29843}
29844impl TERRAIN_DATA_DATA {
29845 pub const ENCODED_LEN: usize = 43usize;
29846 pub const DEFAULT: Self = Self {
29847 lat: 0_i32,
29848 lon: 0_i32,
29849 grid_spacing: 0_u16,
29850 data: [0_i16; 16usize],
29851 gridbit: 0_u8,
29852 };
29853 #[cfg(feature = "arbitrary")]
29854 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29855 use arbitrary::{Arbitrary, Unstructured};
29856 let mut buf = [0u8; 1024];
29857 rng.fill_bytes(&mut buf);
29858 let mut unstructured = Unstructured::new(&buf);
29859 Self::arbitrary(&mut unstructured).unwrap_or_default()
29860 }
29861}
29862impl Default for TERRAIN_DATA_DATA {
29863 fn default() -> Self {
29864 Self::DEFAULT.clone()
29865 }
29866}
29867impl MessageData for TERRAIN_DATA_DATA {
29868 type Message = MavMessage;
29869 const ID: u32 = 134u32;
29870 const NAME: &'static str = "TERRAIN_DATA";
29871 const EXTRA_CRC: u8 = 229u8;
29872 const ENCODED_LEN: usize = 43usize;
29873 fn deser(
29874 _version: MavlinkVersion,
29875 __input: &[u8],
29876 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29877 let avail_len = __input.len();
29878 let mut payload_buf = [0; Self::ENCODED_LEN];
29879 let mut buf = if avail_len < Self::ENCODED_LEN {
29880 payload_buf[0..avail_len].copy_from_slice(__input);
29881 Bytes::new(&payload_buf)
29882 } else {
29883 Bytes::new(__input)
29884 };
29885 let mut __struct = Self::default();
29886 __struct.lat = buf.get_i32_le();
29887 __struct.lon = buf.get_i32_le();
29888 __struct.grid_spacing = buf.get_u16_le();
29889 for v in &mut __struct.data {
29890 let val = buf.get_i16_le();
29891 *v = val;
29892 }
29893 __struct.gridbit = buf.get_u8();
29894 Ok(__struct)
29895 }
29896 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29897 let mut __tmp = BytesMut::new(bytes);
29898 #[allow(clippy::absurd_extreme_comparisons)]
29899 #[allow(unused_comparisons)]
29900 if __tmp.remaining() < Self::ENCODED_LEN {
29901 panic!(
29902 "buffer is too small (need {} bytes, but got {})",
29903 Self::ENCODED_LEN,
29904 __tmp.remaining(),
29905 )
29906 }
29907 __tmp.put_i32_le(self.lat);
29908 __tmp.put_i32_le(self.lon);
29909 __tmp.put_u16_le(self.grid_spacing);
29910 for val in &self.data {
29911 __tmp.put_i16_le(*val);
29912 }
29913 __tmp.put_u8(self.gridbit);
29914 if matches!(version, MavlinkVersion::V2) {
29915 let len = __tmp.len();
29916 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29917 } else {
29918 __tmp.len()
29919 }
29920 }
29921}
29922#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29923#[doc = ""]
29924#[doc = "ID: 136"]
29925#[derive(Debug, Clone, PartialEq)]
29926#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29927#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29928#[cfg_attr(feature = "ts", derive(TS))]
29929#[cfg_attr(feature = "ts", ts(export))]
29930pub struct TERRAIN_REPORT_DATA {
29931 #[doc = "Latitude"]
29932 pub lat: i32,
29933 #[doc = "Longitude"]
29934 pub lon: i32,
29935 #[doc = "Terrain height MSL"]
29936 pub terrain_height: f32,
29937 #[doc = "Current vehicle height above lat/lon terrain height"]
29938 pub current_height: f32,
29939 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
29940 pub spacing: u16,
29941 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
29942 pub pending: u16,
29943 #[doc = "Number of 4x4 terrain blocks in memory"]
29944 pub loaded: u16,
29945}
29946impl TERRAIN_REPORT_DATA {
29947 pub const ENCODED_LEN: usize = 22usize;
29948 pub const DEFAULT: Self = Self {
29949 lat: 0_i32,
29950 lon: 0_i32,
29951 terrain_height: 0.0_f32,
29952 current_height: 0.0_f32,
29953 spacing: 0_u16,
29954 pending: 0_u16,
29955 loaded: 0_u16,
29956 };
29957 #[cfg(feature = "arbitrary")]
29958 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29959 use arbitrary::{Arbitrary, Unstructured};
29960 let mut buf = [0u8; 1024];
29961 rng.fill_bytes(&mut buf);
29962 let mut unstructured = Unstructured::new(&buf);
29963 Self::arbitrary(&mut unstructured).unwrap_or_default()
29964 }
29965}
29966impl Default for TERRAIN_REPORT_DATA {
29967 fn default() -> Self {
29968 Self::DEFAULT.clone()
29969 }
29970}
29971impl MessageData for TERRAIN_REPORT_DATA {
29972 type Message = MavMessage;
29973 const ID: u32 = 136u32;
29974 const NAME: &'static str = "TERRAIN_REPORT";
29975 const EXTRA_CRC: u8 = 1u8;
29976 const ENCODED_LEN: usize = 22usize;
29977 fn deser(
29978 _version: MavlinkVersion,
29979 __input: &[u8],
29980 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29981 let avail_len = __input.len();
29982 let mut payload_buf = [0; Self::ENCODED_LEN];
29983 let mut buf = if avail_len < Self::ENCODED_LEN {
29984 payload_buf[0..avail_len].copy_from_slice(__input);
29985 Bytes::new(&payload_buf)
29986 } else {
29987 Bytes::new(__input)
29988 };
29989 let mut __struct = Self::default();
29990 __struct.lat = buf.get_i32_le();
29991 __struct.lon = buf.get_i32_le();
29992 __struct.terrain_height = buf.get_f32_le();
29993 __struct.current_height = buf.get_f32_le();
29994 __struct.spacing = buf.get_u16_le();
29995 __struct.pending = buf.get_u16_le();
29996 __struct.loaded = buf.get_u16_le();
29997 Ok(__struct)
29998 }
29999 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30000 let mut __tmp = BytesMut::new(bytes);
30001 #[allow(clippy::absurd_extreme_comparisons)]
30002 #[allow(unused_comparisons)]
30003 if __tmp.remaining() < Self::ENCODED_LEN {
30004 panic!(
30005 "buffer is too small (need {} bytes, but got {})",
30006 Self::ENCODED_LEN,
30007 __tmp.remaining(),
30008 )
30009 }
30010 __tmp.put_i32_le(self.lat);
30011 __tmp.put_i32_le(self.lon);
30012 __tmp.put_f32_le(self.terrain_height);
30013 __tmp.put_f32_le(self.current_height);
30014 __tmp.put_u16_le(self.spacing);
30015 __tmp.put_u16_le(self.pending);
30016 __tmp.put_u16_le(self.loaded);
30017 if matches!(version, MavlinkVersion::V2) {
30018 let len = __tmp.len();
30019 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30020 } else {
30021 __tmp.len()
30022 }
30023 }
30024}
30025#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
30026#[doc = ""]
30027#[doc = "ID: 133"]
30028#[derive(Debug, Clone, PartialEq)]
30029#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30030#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30031#[cfg_attr(feature = "ts", derive(TS))]
30032#[cfg_attr(feature = "ts", ts(export))]
30033pub struct TERRAIN_REQUEST_DATA {
30034 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
30035 pub mask: u64,
30036 #[doc = "Latitude of SW corner of first grid"]
30037 pub lat: i32,
30038 #[doc = "Longitude of SW corner of first grid"]
30039 pub lon: i32,
30040 #[doc = "Grid spacing"]
30041 pub grid_spacing: u16,
30042}
30043impl TERRAIN_REQUEST_DATA {
30044 pub const ENCODED_LEN: usize = 18usize;
30045 pub const DEFAULT: Self = Self {
30046 mask: 0_u64,
30047 lat: 0_i32,
30048 lon: 0_i32,
30049 grid_spacing: 0_u16,
30050 };
30051 #[cfg(feature = "arbitrary")]
30052 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30053 use arbitrary::{Arbitrary, Unstructured};
30054 let mut buf = [0u8; 1024];
30055 rng.fill_bytes(&mut buf);
30056 let mut unstructured = Unstructured::new(&buf);
30057 Self::arbitrary(&mut unstructured).unwrap_or_default()
30058 }
30059}
30060impl Default for TERRAIN_REQUEST_DATA {
30061 fn default() -> Self {
30062 Self::DEFAULT.clone()
30063 }
30064}
30065impl MessageData for TERRAIN_REQUEST_DATA {
30066 type Message = MavMessage;
30067 const ID: u32 = 133u32;
30068 const NAME: &'static str = "TERRAIN_REQUEST";
30069 const EXTRA_CRC: u8 = 6u8;
30070 const ENCODED_LEN: usize = 18usize;
30071 fn deser(
30072 _version: MavlinkVersion,
30073 __input: &[u8],
30074 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30075 let avail_len = __input.len();
30076 let mut payload_buf = [0; Self::ENCODED_LEN];
30077 let mut buf = if avail_len < Self::ENCODED_LEN {
30078 payload_buf[0..avail_len].copy_from_slice(__input);
30079 Bytes::new(&payload_buf)
30080 } else {
30081 Bytes::new(__input)
30082 };
30083 let mut __struct = Self::default();
30084 __struct.mask = buf.get_u64_le();
30085 __struct.lat = buf.get_i32_le();
30086 __struct.lon = buf.get_i32_le();
30087 __struct.grid_spacing = buf.get_u16_le();
30088 Ok(__struct)
30089 }
30090 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30091 let mut __tmp = BytesMut::new(bytes);
30092 #[allow(clippy::absurd_extreme_comparisons)]
30093 #[allow(unused_comparisons)]
30094 if __tmp.remaining() < Self::ENCODED_LEN {
30095 panic!(
30096 "buffer is too small (need {} bytes, but got {})",
30097 Self::ENCODED_LEN,
30098 __tmp.remaining(),
30099 )
30100 }
30101 __tmp.put_u64_le(self.mask);
30102 __tmp.put_i32_le(self.lat);
30103 __tmp.put_i32_le(self.lon);
30104 __tmp.put_u16_le(self.grid_spacing);
30105 if matches!(version, MavlinkVersion::V2) {
30106 let len = __tmp.len();
30107 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30108 } else {
30109 __tmp.len()
30110 }
30111 }
30112}
30113#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
30114#[doc = ""]
30115#[doc = "ID: 111"]
30116#[derive(Debug, Clone, PartialEq)]
30117#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30118#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30119#[cfg_attr(feature = "ts", derive(TS))]
30120#[cfg_attr(feature = "ts", ts(export))]
30121pub struct TIMESYNC_DATA {
30122 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
30123 pub tc1: i64,
30124 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
30125 pub ts1: i64,
30126 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
30127 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30128 pub target_system: u8,
30129 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
30130 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30131 pub target_component: u8,
30132}
30133impl TIMESYNC_DATA {
30134 pub const ENCODED_LEN: usize = 18usize;
30135 pub const DEFAULT: Self = Self {
30136 tc1: 0_i64,
30137 ts1: 0_i64,
30138 target_system: 0_u8,
30139 target_component: 0_u8,
30140 };
30141 #[cfg(feature = "arbitrary")]
30142 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30143 use arbitrary::{Arbitrary, Unstructured};
30144 let mut buf = [0u8; 1024];
30145 rng.fill_bytes(&mut buf);
30146 let mut unstructured = Unstructured::new(&buf);
30147 Self::arbitrary(&mut unstructured).unwrap_or_default()
30148 }
30149}
30150impl Default for TIMESYNC_DATA {
30151 fn default() -> Self {
30152 Self::DEFAULT.clone()
30153 }
30154}
30155impl MessageData for TIMESYNC_DATA {
30156 type Message = MavMessage;
30157 const ID: u32 = 111u32;
30158 const NAME: &'static str = "TIMESYNC";
30159 const EXTRA_CRC: u8 = 34u8;
30160 const ENCODED_LEN: usize = 18usize;
30161 fn deser(
30162 _version: MavlinkVersion,
30163 __input: &[u8],
30164 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30165 let avail_len = __input.len();
30166 let mut payload_buf = [0; Self::ENCODED_LEN];
30167 let mut buf = if avail_len < Self::ENCODED_LEN {
30168 payload_buf[0..avail_len].copy_from_slice(__input);
30169 Bytes::new(&payload_buf)
30170 } else {
30171 Bytes::new(__input)
30172 };
30173 let mut __struct = Self::default();
30174 __struct.tc1 = buf.get_i64_le();
30175 __struct.ts1 = buf.get_i64_le();
30176 __struct.target_system = buf.get_u8();
30177 __struct.target_component = buf.get_u8();
30178 Ok(__struct)
30179 }
30180 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30181 let mut __tmp = BytesMut::new(bytes);
30182 #[allow(clippy::absurd_extreme_comparisons)]
30183 #[allow(unused_comparisons)]
30184 if __tmp.remaining() < Self::ENCODED_LEN {
30185 panic!(
30186 "buffer is too small (need {} bytes, but got {})",
30187 Self::ENCODED_LEN,
30188 __tmp.remaining(),
30189 )
30190 }
30191 __tmp.put_i64_le(self.tc1);
30192 __tmp.put_i64_le(self.ts1);
30193 if matches!(version, MavlinkVersion::V2) {
30194 __tmp.put_u8(self.target_system);
30195 __tmp.put_u8(self.target_component);
30196 let len = __tmp.len();
30197 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30198 } else {
30199 __tmp.len()
30200 }
30201 }
30202}
30203#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
30204#[doc = ""]
30205#[doc = "ID: 380"]
30206#[derive(Debug, Clone, PartialEq)]
30207#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30208#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30209#[cfg_attr(feature = "ts", derive(TS))]
30210#[cfg_attr(feature = "ts", ts(export))]
30211pub struct TIME_ESTIMATE_TO_TARGET_DATA {
30212 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
30213 pub safe_return: i32,
30214 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
30215 pub land: i32,
30216 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
30217 pub mission_next_item: i32,
30218 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
30219 pub mission_end: i32,
30220 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
30221 pub commanded_action: i32,
30222}
30223impl TIME_ESTIMATE_TO_TARGET_DATA {
30224 pub const ENCODED_LEN: usize = 20usize;
30225 pub const DEFAULT: Self = Self {
30226 safe_return: 0_i32,
30227 land: 0_i32,
30228 mission_next_item: 0_i32,
30229 mission_end: 0_i32,
30230 commanded_action: 0_i32,
30231 };
30232 #[cfg(feature = "arbitrary")]
30233 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30234 use arbitrary::{Arbitrary, Unstructured};
30235 let mut buf = [0u8; 1024];
30236 rng.fill_bytes(&mut buf);
30237 let mut unstructured = Unstructured::new(&buf);
30238 Self::arbitrary(&mut unstructured).unwrap_or_default()
30239 }
30240}
30241impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
30242 fn default() -> Self {
30243 Self::DEFAULT.clone()
30244 }
30245}
30246impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
30247 type Message = MavMessage;
30248 const ID: u32 = 380u32;
30249 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
30250 const EXTRA_CRC: u8 = 232u8;
30251 const ENCODED_LEN: usize = 20usize;
30252 fn deser(
30253 _version: MavlinkVersion,
30254 __input: &[u8],
30255 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30256 let avail_len = __input.len();
30257 let mut payload_buf = [0; Self::ENCODED_LEN];
30258 let mut buf = if avail_len < Self::ENCODED_LEN {
30259 payload_buf[0..avail_len].copy_from_slice(__input);
30260 Bytes::new(&payload_buf)
30261 } else {
30262 Bytes::new(__input)
30263 };
30264 let mut __struct = Self::default();
30265 __struct.safe_return = buf.get_i32_le();
30266 __struct.land = buf.get_i32_le();
30267 __struct.mission_next_item = buf.get_i32_le();
30268 __struct.mission_end = buf.get_i32_le();
30269 __struct.commanded_action = buf.get_i32_le();
30270 Ok(__struct)
30271 }
30272 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30273 let mut __tmp = BytesMut::new(bytes);
30274 #[allow(clippy::absurd_extreme_comparisons)]
30275 #[allow(unused_comparisons)]
30276 if __tmp.remaining() < Self::ENCODED_LEN {
30277 panic!(
30278 "buffer is too small (need {} bytes, but got {})",
30279 Self::ENCODED_LEN,
30280 __tmp.remaining(),
30281 )
30282 }
30283 __tmp.put_i32_le(self.safe_return);
30284 __tmp.put_i32_le(self.land);
30285 __tmp.put_i32_le(self.mission_next_item);
30286 __tmp.put_i32_le(self.mission_end);
30287 __tmp.put_i32_le(self.commanded_action);
30288 if matches!(version, MavlinkVersion::V2) {
30289 let len = __tmp.len();
30290 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30291 } else {
30292 __tmp.len()
30293 }
30294 }
30295}
30296#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
30297#[doc = ""]
30298#[doc = "ID: 333"]
30299#[derive(Debug, Clone, PartialEq)]
30300#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30301#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30302#[cfg_attr(feature = "ts", derive(TS))]
30303#[cfg_attr(feature = "ts", ts(export))]
30304pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30305 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30306 pub time_usec: u64,
30307 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
30308 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30309 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30310 pub pos_x: [f32; 5],
30311 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
30312 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30313 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30314 pub pos_y: [f32; 5],
30315 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
30316 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30317 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30318 pub pos_z: [f32; 5],
30319 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
30320 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30321 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30322 pub delta: [f32; 5],
30323 #[doc = "Yaw. Set to NaN for unchanged"]
30324 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30325 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30326 pub pos_yaw: [f32; 5],
30327 #[doc = "Number of valid control points (up-to 5 points are possible)"]
30328 pub valid_points: u8,
30329}
30330impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30331 pub const ENCODED_LEN: usize = 109usize;
30332 pub const DEFAULT: Self = Self {
30333 time_usec: 0_u64,
30334 pos_x: [0.0_f32; 5usize],
30335 pos_y: [0.0_f32; 5usize],
30336 pos_z: [0.0_f32; 5usize],
30337 delta: [0.0_f32; 5usize],
30338 pos_yaw: [0.0_f32; 5usize],
30339 valid_points: 0_u8,
30340 };
30341 #[cfg(feature = "arbitrary")]
30342 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30343 use arbitrary::{Arbitrary, Unstructured};
30344 let mut buf = [0u8; 1024];
30345 rng.fill_bytes(&mut buf);
30346 let mut unstructured = Unstructured::new(&buf);
30347 Self::arbitrary(&mut unstructured).unwrap_or_default()
30348 }
30349}
30350impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30351 fn default() -> Self {
30352 Self::DEFAULT.clone()
30353 }
30354}
30355impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30356 type Message = MavMessage;
30357 const ID: u32 = 333u32;
30358 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
30359 const EXTRA_CRC: u8 = 231u8;
30360 const ENCODED_LEN: usize = 109usize;
30361 fn deser(
30362 _version: MavlinkVersion,
30363 __input: &[u8],
30364 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30365 let avail_len = __input.len();
30366 let mut payload_buf = [0; Self::ENCODED_LEN];
30367 let mut buf = if avail_len < Self::ENCODED_LEN {
30368 payload_buf[0..avail_len].copy_from_slice(__input);
30369 Bytes::new(&payload_buf)
30370 } else {
30371 Bytes::new(__input)
30372 };
30373 let mut __struct = Self::default();
30374 __struct.time_usec = buf.get_u64_le();
30375 for v in &mut __struct.pos_x {
30376 let val = buf.get_f32_le();
30377 *v = val;
30378 }
30379 for v in &mut __struct.pos_y {
30380 let val = buf.get_f32_le();
30381 *v = val;
30382 }
30383 for v in &mut __struct.pos_z {
30384 let val = buf.get_f32_le();
30385 *v = val;
30386 }
30387 for v in &mut __struct.delta {
30388 let val = buf.get_f32_le();
30389 *v = val;
30390 }
30391 for v in &mut __struct.pos_yaw {
30392 let val = buf.get_f32_le();
30393 *v = val;
30394 }
30395 __struct.valid_points = buf.get_u8();
30396 Ok(__struct)
30397 }
30398 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30399 let mut __tmp = BytesMut::new(bytes);
30400 #[allow(clippy::absurd_extreme_comparisons)]
30401 #[allow(unused_comparisons)]
30402 if __tmp.remaining() < Self::ENCODED_LEN {
30403 panic!(
30404 "buffer is too small (need {} bytes, but got {})",
30405 Self::ENCODED_LEN,
30406 __tmp.remaining(),
30407 )
30408 }
30409 __tmp.put_u64_le(self.time_usec);
30410 for val in &self.pos_x {
30411 __tmp.put_f32_le(*val);
30412 }
30413 for val in &self.pos_y {
30414 __tmp.put_f32_le(*val);
30415 }
30416 for val in &self.pos_z {
30417 __tmp.put_f32_le(*val);
30418 }
30419 for val in &self.delta {
30420 __tmp.put_f32_le(*val);
30421 }
30422 for val in &self.pos_yaw {
30423 __tmp.put_f32_le(*val);
30424 }
30425 __tmp.put_u8(self.valid_points);
30426 if matches!(version, MavlinkVersion::V2) {
30427 let len = __tmp.len();
30428 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30429 } else {
30430 __tmp.len()
30431 }
30432 }
30433}
30434#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
30435#[doc = ""]
30436#[doc = "ID: 332"]
30437#[derive(Debug, Clone, PartialEq)]
30438#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30439#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30440#[cfg_attr(feature = "ts", derive(TS))]
30441#[cfg_attr(feature = "ts", ts(export))]
30442pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30443 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30444 pub time_usec: u64,
30445 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
30446 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30447 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30448 pub pos_x: [f32; 5],
30449 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
30450 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30451 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30452 pub pos_y: [f32; 5],
30453 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
30454 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30455 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30456 pub pos_z: [f32; 5],
30457 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
30458 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30459 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30460 pub vel_x: [f32; 5],
30461 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
30462 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30463 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30464 pub vel_y: [f32; 5],
30465 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
30466 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30467 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30468 pub vel_z: [f32; 5],
30469 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
30470 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30471 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30472 pub acc_x: [f32; 5],
30473 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
30474 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30475 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30476 pub acc_y: [f32; 5],
30477 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
30478 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30479 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30480 pub acc_z: [f32; 5],
30481 #[doc = "Yaw angle, set to NaN if not being used"]
30482 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30483 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30484 pub pos_yaw: [f32; 5],
30485 #[doc = "Yaw rate, set to NaN if not being used"]
30486 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30487 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30488 pub vel_yaw: [f32; 5],
30489 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
30490 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30491 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30492 pub command: [u16; 5],
30493 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
30494 pub valid_points: u8,
30495}
30496impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30497 pub const ENCODED_LEN: usize = 239usize;
30498 pub const DEFAULT: Self = Self {
30499 time_usec: 0_u64,
30500 pos_x: [0.0_f32; 5usize],
30501 pos_y: [0.0_f32; 5usize],
30502 pos_z: [0.0_f32; 5usize],
30503 vel_x: [0.0_f32; 5usize],
30504 vel_y: [0.0_f32; 5usize],
30505 vel_z: [0.0_f32; 5usize],
30506 acc_x: [0.0_f32; 5usize],
30507 acc_y: [0.0_f32; 5usize],
30508 acc_z: [0.0_f32; 5usize],
30509 pos_yaw: [0.0_f32; 5usize],
30510 vel_yaw: [0.0_f32; 5usize],
30511 command: [0_u16; 5usize],
30512 valid_points: 0_u8,
30513 };
30514 #[cfg(feature = "arbitrary")]
30515 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30516 use arbitrary::{Arbitrary, Unstructured};
30517 let mut buf = [0u8; 1024];
30518 rng.fill_bytes(&mut buf);
30519 let mut unstructured = Unstructured::new(&buf);
30520 Self::arbitrary(&mut unstructured).unwrap_or_default()
30521 }
30522}
30523impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30524 fn default() -> Self {
30525 Self::DEFAULT.clone()
30526 }
30527}
30528impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30529 type Message = MavMessage;
30530 const ID: u32 = 332u32;
30531 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
30532 const EXTRA_CRC: u8 = 236u8;
30533 const ENCODED_LEN: usize = 239usize;
30534 fn deser(
30535 _version: MavlinkVersion,
30536 __input: &[u8],
30537 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30538 let avail_len = __input.len();
30539 let mut payload_buf = [0; Self::ENCODED_LEN];
30540 let mut buf = if avail_len < Self::ENCODED_LEN {
30541 payload_buf[0..avail_len].copy_from_slice(__input);
30542 Bytes::new(&payload_buf)
30543 } else {
30544 Bytes::new(__input)
30545 };
30546 let mut __struct = Self::default();
30547 __struct.time_usec = buf.get_u64_le();
30548 for v in &mut __struct.pos_x {
30549 let val = buf.get_f32_le();
30550 *v = val;
30551 }
30552 for v in &mut __struct.pos_y {
30553 let val = buf.get_f32_le();
30554 *v = val;
30555 }
30556 for v in &mut __struct.pos_z {
30557 let val = buf.get_f32_le();
30558 *v = val;
30559 }
30560 for v in &mut __struct.vel_x {
30561 let val = buf.get_f32_le();
30562 *v = val;
30563 }
30564 for v in &mut __struct.vel_y {
30565 let val = buf.get_f32_le();
30566 *v = val;
30567 }
30568 for v in &mut __struct.vel_z {
30569 let val = buf.get_f32_le();
30570 *v = val;
30571 }
30572 for v in &mut __struct.acc_x {
30573 let val = buf.get_f32_le();
30574 *v = val;
30575 }
30576 for v in &mut __struct.acc_y {
30577 let val = buf.get_f32_le();
30578 *v = val;
30579 }
30580 for v in &mut __struct.acc_z {
30581 let val = buf.get_f32_le();
30582 *v = val;
30583 }
30584 for v in &mut __struct.pos_yaw {
30585 let val = buf.get_f32_le();
30586 *v = val;
30587 }
30588 for v in &mut __struct.vel_yaw {
30589 let val = buf.get_f32_le();
30590 *v = val;
30591 }
30592 for v in &mut __struct.command {
30593 let val = buf.get_u16_le();
30594 *v = val;
30595 }
30596 __struct.valid_points = buf.get_u8();
30597 Ok(__struct)
30598 }
30599 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30600 let mut __tmp = BytesMut::new(bytes);
30601 #[allow(clippy::absurd_extreme_comparisons)]
30602 #[allow(unused_comparisons)]
30603 if __tmp.remaining() < Self::ENCODED_LEN {
30604 panic!(
30605 "buffer is too small (need {} bytes, but got {})",
30606 Self::ENCODED_LEN,
30607 __tmp.remaining(),
30608 )
30609 }
30610 __tmp.put_u64_le(self.time_usec);
30611 for val in &self.pos_x {
30612 __tmp.put_f32_le(*val);
30613 }
30614 for val in &self.pos_y {
30615 __tmp.put_f32_le(*val);
30616 }
30617 for val in &self.pos_z {
30618 __tmp.put_f32_le(*val);
30619 }
30620 for val in &self.vel_x {
30621 __tmp.put_f32_le(*val);
30622 }
30623 for val in &self.vel_y {
30624 __tmp.put_f32_le(*val);
30625 }
30626 for val in &self.vel_z {
30627 __tmp.put_f32_le(*val);
30628 }
30629 for val in &self.acc_x {
30630 __tmp.put_f32_le(*val);
30631 }
30632 for val in &self.acc_y {
30633 __tmp.put_f32_le(*val);
30634 }
30635 for val in &self.acc_z {
30636 __tmp.put_f32_le(*val);
30637 }
30638 for val in &self.pos_yaw {
30639 __tmp.put_f32_le(*val);
30640 }
30641 for val in &self.vel_yaw {
30642 __tmp.put_f32_le(*val);
30643 }
30644 for val in &self.command {
30645 __tmp.put_u16_le(*val);
30646 }
30647 __tmp.put_u8(self.valid_points);
30648 if matches!(version, MavlinkVersion::V2) {
30649 let len = __tmp.len();
30650 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30651 } else {
30652 __tmp.len()
30653 }
30654 }
30655}
30656#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
30657#[doc = ""]
30658#[doc = "ID: 385"]
30659#[derive(Debug, Clone, PartialEq)]
30660#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30661#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30662#[cfg_attr(feature = "ts", derive(TS))]
30663#[cfg_attr(feature = "ts", ts(export))]
30664pub struct TUNNEL_DATA {
30665 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
30666 pub payload_type: MavTunnelPayloadType,
30667 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
30668 pub target_system: u8,
30669 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
30670 pub target_component: u8,
30671 #[doc = "Length of the data transported in payload"]
30672 pub payload_length: u8,
30673 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
30674 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30675 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30676 pub payload: [u8; 128],
30677}
30678impl TUNNEL_DATA {
30679 pub const ENCODED_LEN: usize = 133usize;
30680 pub const DEFAULT: Self = Self {
30681 payload_type: MavTunnelPayloadType::DEFAULT,
30682 target_system: 0_u8,
30683 target_component: 0_u8,
30684 payload_length: 0_u8,
30685 payload: [0_u8; 128usize],
30686 };
30687 #[cfg(feature = "arbitrary")]
30688 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30689 use arbitrary::{Arbitrary, Unstructured};
30690 let mut buf = [0u8; 1024];
30691 rng.fill_bytes(&mut buf);
30692 let mut unstructured = Unstructured::new(&buf);
30693 Self::arbitrary(&mut unstructured).unwrap_or_default()
30694 }
30695}
30696impl Default for TUNNEL_DATA {
30697 fn default() -> Self {
30698 Self::DEFAULT.clone()
30699 }
30700}
30701impl MessageData for TUNNEL_DATA {
30702 type Message = MavMessage;
30703 const ID: u32 = 385u32;
30704 const NAME: &'static str = "TUNNEL";
30705 const EXTRA_CRC: u8 = 147u8;
30706 const ENCODED_LEN: usize = 133usize;
30707 fn deser(
30708 _version: MavlinkVersion,
30709 __input: &[u8],
30710 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30711 let avail_len = __input.len();
30712 let mut payload_buf = [0; Self::ENCODED_LEN];
30713 let mut buf = if avail_len < Self::ENCODED_LEN {
30714 payload_buf[0..avail_len].copy_from_slice(__input);
30715 Bytes::new(&payload_buf)
30716 } else {
30717 Bytes::new(__input)
30718 };
30719 let mut __struct = Self::default();
30720 let tmp = buf.get_u16_le();
30721 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
30722 ::mavlink_core::error::ParserError::InvalidEnum {
30723 enum_type: "MavTunnelPayloadType",
30724 value: tmp as u64,
30725 },
30726 )?;
30727 __struct.target_system = buf.get_u8();
30728 __struct.target_component = buf.get_u8();
30729 __struct.payload_length = buf.get_u8();
30730 for v in &mut __struct.payload {
30731 let val = buf.get_u8();
30732 *v = val;
30733 }
30734 Ok(__struct)
30735 }
30736 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30737 let mut __tmp = BytesMut::new(bytes);
30738 #[allow(clippy::absurd_extreme_comparisons)]
30739 #[allow(unused_comparisons)]
30740 if __tmp.remaining() < Self::ENCODED_LEN {
30741 panic!(
30742 "buffer is too small (need {} bytes, but got {})",
30743 Self::ENCODED_LEN,
30744 __tmp.remaining(),
30745 )
30746 }
30747 __tmp.put_u16_le(self.payload_type as u16);
30748 __tmp.put_u8(self.target_system);
30749 __tmp.put_u8(self.target_component);
30750 __tmp.put_u8(self.payload_length);
30751 for val in &self.payload {
30752 __tmp.put_u8(*val);
30753 }
30754 if matches!(version, MavlinkVersion::V2) {
30755 let len = __tmp.len();
30756 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30757 } else {
30758 __tmp.len()
30759 }
30760 }
30761}
30762#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
30763#[doc = ""]
30764#[doc = "ID: 311"]
30765#[derive(Debug, Clone, PartialEq)]
30766#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30767#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30768#[cfg_attr(feature = "ts", derive(TS))]
30769#[cfg_attr(feature = "ts", ts(export))]
30770pub struct UAVCAN_NODE_INFO_DATA {
30771 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30772 pub time_usec: u64,
30773 #[doc = "Time since the start-up of the node."]
30774 pub uptime_sec: u32,
30775 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
30776 pub sw_vcs_commit: u32,
30777 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
30778 #[cfg_attr(feature = "ts", ts(type = "string"))]
30779 pub name: CharArray<80>,
30780 #[doc = "Hardware major version number."]
30781 pub hw_version_major: u8,
30782 #[doc = "Hardware minor version number."]
30783 pub hw_version_minor: u8,
30784 #[doc = "Hardware unique 128-bit ID."]
30785 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30786 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30787 pub hw_unique_id: [u8; 16],
30788 #[doc = "Software major version number."]
30789 pub sw_version_major: u8,
30790 #[doc = "Software minor version number."]
30791 pub sw_version_minor: u8,
30792}
30793impl UAVCAN_NODE_INFO_DATA {
30794 pub const ENCODED_LEN: usize = 116usize;
30795 pub const DEFAULT: Self = Self {
30796 time_usec: 0_u64,
30797 uptime_sec: 0_u32,
30798 sw_vcs_commit: 0_u32,
30799 name: CharArray::new([0_u8; 80usize]),
30800 hw_version_major: 0_u8,
30801 hw_version_minor: 0_u8,
30802 hw_unique_id: [0_u8; 16usize],
30803 sw_version_major: 0_u8,
30804 sw_version_minor: 0_u8,
30805 };
30806 #[cfg(feature = "arbitrary")]
30807 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30808 use arbitrary::{Arbitrary, Unstructured};
30809 let mut buf = [0u8; 1024];
30810 rng.fill_bytes(&mut buf);
30811 let mut unstructured = Unstructured::new(&buf);
30812 Self::arbitrary(&mut unstructured).unwrap_or_default()
30813 }
30814}
30815impl Default for UAVCAN_NODE_INFO_DATA {
30816 fn default() -> Self {
30817 Self::DEFAULT.clone()
30818 }
30819}
30820impl MessageData for UAVCAN_NODE_INFO_DATA {
30821 type Message = MavMessage;
30822 const ID: u32 = 311u32;
30823 const NAME: &'static str = "UAVCAN_NODE_INFO";
30824 const EXTRA_CRC: u8 = 95u8;
30825 const ENCODED_LEN: usize = 116usize;
30826 fn deser(
30827 _version: MavlinkVersion,
30828 __input: &[u8],
30829 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30830 let avail_len = __input.len();
30831 let mut payload_buf = [0; Self::ENCODED_LEN];
30832 let mut buf = if avail_len < Self::ENCODED_LEN {
30833 payload_buf[0..avail_len].copy_from_slice(__input);
30834 Bytes::new(&payload_buf)
30835 } else {
30836 Bytes::new(__input)
30837 };
30838 let mut __struct = Self::default();
30839 __struct.time_usec = buf.get_u64_le();
30840 __struct.uptime_sec = buf.get_u32_le();
30841 __struct.sw_vcs_commit = buf.get_u32_le();
30842 let mut tmp = [0_u8; 80usize];
30843 for v in &mut tmp {
30844 *v = buf.get_u8();
30845 }
30846 __struct.name = CharArray::new(tmp);
30847 __struct.hw_version_major = buf.get_u8();
30848 __struct.hw_version_minor = buf.get_u8();
30849 for v in &mut __struct.hw_unique_id {
30850 let val = buf.get_u8();
30851 *v = val;
30852 }
30853 __struct.sw_version_major = buf.get_u8();
30854 __struct.sw_version_minor = buf.get_u8();
30855 Ok(__struct)
30856 }
30857 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30858 let mut __tmp = BytesMut::new(bytes);
30859 #[allow(clippy::absurd_extreme_comparisons)]
30860 #[allow(unused_comparisons)]
30861 if __tmp.remaining() < Self::ENCODED_LEN {
30862 panic!(
30863 "buffer is too small (need {} bytes, but got {})",
30864 Self::ENCODED_LEN,
30865 __tmp.remaining(),
30866 )
30867 }
30868 __tmp.put_u64_le(self.time_usec);
30869 __tmp.put_u32_le(self.uptime_sec);
30870 __tmp.put_u32_le(self.sw_vcs_commit);
30871 for val in &self.name {
30872 __tmp.put_u8(*val);
30873 }
30874 __tmp.put_u8(self.hw_version_major);
30875 __tmp.put_u8(self.hw_version_minor);
30876 for val in &self.hw_unique_id {
30877 __tmp.put_u8(*val);
30878 }
30879 __tmp.put_u8(self.sw_version_major);
30880 __tmp.put_u8(self.sw_version_minor);
30881 if matches!(version, MavlinkVersion::V2) {
30882 let len = __tmp.len();
30883 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30884 } else {
30885 __tmp.len()
30886 }
30887 }
30888}
30889#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
30890#[doc = ""]
30891#[doc = "ID: 310"]
30892#[derive(Debug, Clone, PartialEq)]
30893#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30894#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30895#[cfg_attr(feature = "ts", derive(TS))]
30896#[cfg_attr(feature = "ts", ts(export))]
30897pub struct UAVCAN_NODE_STATUS_DATA {
30898 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30899 pub time_usec: u64,
30900 #[doc = "Time since the start-up of the node."]
30901 pub uptime_sec: u32,
30902 #[doc = "Vendor-specific status information."]
30903 pub vendor_specific_status_code: u16,
30904 #[doc = "Generalized node health status."]
30905 pub health: UavcanNodeHealth,
30906 #[doc = "Generalized operating mode."]
30907 pub mode: UavcanNodeMode,
30908 #[doc = "Not used currently."]
30909 pub sub_mode: u8,
30910}
30911impl UAVCAN_NODE_STATUS_DATA {
30912 pub const ENCODED_LEN: usize = 17usize;
30913 pub const DEFAULT: Self = Self {
30914 time_usec: 0_u64,
30915 uptime_sec: 0_u32,
30916 vendor_specific_status_code: 0_u16,
30917 health: UavcanNodeHealth::DEFAULT,
30918 mode: UavcanNodeMode::DEFAULT,
30919 sub_mode: 0_u8,
30920 };
30921 #[cfg(feature = "arbitrary")]
30922 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30923 use arbitrary::{Arbitrary, Unstructured};
30924 let mut buf = [0u8; 1024];
30925 rng.fill_bytes(&mut buf);
30926 let mut unstructured = Unstructured::new(&buf);
30927 Self::arbitrary(&mut unstructured).unwrap_or_default()
30928 }
30929}
30930impl Default for UAVCAN_NODE_STATUS_DATA {
30931 fn default() -> Self {
30932 Self::DEFAULT.clone()
30933 }
30934}
30935impl MessageData for UAVCAN_NODE_STATUS_DATA {
30936 type Message = MavMessage;
30937 const ID: u32 = 310u32;
30938 const NAME: &'static str = "UAVCAN_NODE_STATUS";
30939 const EXTRA_CRC: u8 = 28u8;
30940 const ENCODED_LEN: usize = 17usize;
30941 fn deser(
30942 _version: MavlinkVersion,
30943 __input: &[u8],
30944 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30945 let avail_len = __input.len();
30946 let mut payload_buf = [0; Self::ENCODED_LEN];
30947 let mut buf = if avail_len < Self::ENCODED_LEN {
30948 payload_buf[0..avail_len].copy_from_slice(__input);
30949 Bytes::new(&payload_buf)
30950 } else {
30951 Bytes::new(__input)
30952 };
30953 let mut __struct = Self::default();
30954 __struct.time_usec = buf.get_u64_le();
30955 __struct.uptime_sec = buf.get_u32_le();
30956 __struct.vendor_specific_status_code = buf.get_u16_le();
30957 let tmp = buf.get_u8();
30958 __struct.health =
30959 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30960 enum_type: "UavcanNodeHealth",
30961 value: tmp as u64,
30962 })?;
30963 let tmp = buf.get_u8();
30964 __struct.mode =
30965 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30966 enum_type: "UavcanNodeMode",
30967 value: tmp as u64,
30968 })?;
30969 __struct.sub_mode = buf.get_u8();
30970 Ok(__struct)
30971 }
30972 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30973 let mut __tmp = BytesMut::new(bytes);
30974 #[allow(clippy::absurd_extreme_comparisons)]
30975 #[allow(unused_comparisons)]
30976 if __tmp.remaining() < Self::ENCODED_LEN {
30977 panic!(
30978 "buffer is too small (need {} bytes, but got {})",
30979 Self::ENCODED_LEN,
30980 __tmp.remaining(),
30981 )
30982 }
30983 __tmp.put_u64_le(self.time_usec);
30984 __tmp.put_u32_le(self.uptime_sec);
30985 __tmp.put_u16_le(self.vendor_specific_status_code);
30986 __tmp.put_u8(self.health as u8);
30987 __tmp.put_u8(self.mode as u8);
30988 __tmp.put_u8(self.sub_mode);
30989 if matches!(version, MavlinkVersion::V2) {
30990 let len = __tmp.len();
30991 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30992 } else {
30993 __tmp.len()
30994 }
30995 }
30996}
30997#[doc = "The global position resulting from GPS and sensor fusion."]
30998#[doc = ""]
30999#[doc = "ID: 340"]
31000#[derive(Debug, Clone, PartialEq)]
31001#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31002#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31003#[cfg_attr(feature = "ts", derive(TS))]
31004#[cfg_attr(feature = "ts", ts(export))]
31005pub struct UTM_GLOBAL_POSITION_DATA {
31006 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
31007 pub time: u64,
31008 #[doc = "Latitude (WGS84)"]
31009 pub lat: i32,
31010 #[doc = "Longitude (WGS84)"]
31011 pub lon: i32,
31012 #[doc = "Altitude (WGS84)"]
31013 pub alt: i32,
31014 #[doc = "Altitude above ground"]
31015 pub relative_alt: i32,
31016 #[doc = "Next waypoint, latitude (WGS84)"]
31017 pub next_lat: i32,
31018 #[doc = "Next waypoint, longitude (WGS84)"]
31019 pub next_lon: i32,
31020 #[doc = "Next waypoint, altitude (WGS84)"]
31021 pub next_alt: i32,
31022 #[doc = "Ground X speed (latitude, positive north)"]
31023 pub vx: i16,
31024 #[doc = "Ground Y speed (longitude, positive east)"]
31025 pub vy: i16,
31026 #[doc = "Ground Z speed (altitude, positive down)"]
31027 pub vz: i16,
31028 #[doc = "Horizontal position uncertainty (standard deviation)"]
31029 pub h_acc: u16,
31030 #[doc = "Altitude uncertainty (standard deviation)"]
31031 pub v_acc: u16,
31032 #[doc = "Speed uncertainty (standard deviation)"]
31033 pub vel_acc: u16,
31034 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
31035 pub update_rate: u16,
31036 #[doc = "Unique UAS ID."]
31037 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31038 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31039 pub uas_id: [u8; 18],
31040 #[doc = "Flight state"]
31041 pub flight_state: UtmFlightState,
31042 #[doc = "Bitwise OR combination of the data available flags."]
31043 pub flags: UtmDataAvailFlags,
31044}
31045impl UTM_GLOBAL_POSITION_DATA {
31046 pub const ENCODED_LEN: usize = 70usize;
31047 pub const DEFAULT: Self = Self {
31048 time: 0_u64,
31049 lat: 0_i32,
31050 lon: 0_i32,
31051 alt: 0_i32,
31052 relative_alt: 0_i32,
31053 next_lat: 0_i32,
31054 next_lon: 0_i32,
31055 next_alt: 0_i32,
31056 vx: 0_i16,
31057 vy: 0_i16,
31058 vz: 0_i16,
31059 h_acc: 0_u16,
31060 v_acc: 0_u16,
31061 vel_acc: 0_u16,
31062 update_rate: 0_u16,
31063 uas_id: [0_u8; 18usize],
31064 flight_state: UtmFlightState::DEFAULT,
31065 flags: UtmDataAvailFlags::DEFAULT,
31066 };
31067 #[cfg(feature = "arbitrary")]
31068 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31069 use arbitrary::{Arbitrary, Unstructured};
31070 let mut buf = [0u8; 1024];
31071 rng.fill_bytes(&mut buf);
31072 let mut unstructured = Unstructured::new(&buf);
31073 Self::arbitrary(&mut unstructured).unwrap_or_default()
31074 }
31075}
31076impl Default for UTM_GLOBAL_POSITION_DATA {
31077 fn default() -> Self {
31078 Self::DEFAULT.clone()
31079 }
31080}
31081impl MessageData for UTM_GLOBAL_POSITION_DATA {
31082 type Message = MavMessage;
31083 const ID: u32 = 340u32;
31084 const NAME: &'static str = "UTM_GLOBAL_POSITION";
31085 const EXTRA_CRC: u8 = 99u8;
31086 const ENCODED_LEN: usize = 70usize;
31087 fn deser(
31088 _version: MavlinkVersion,
31089 __input: &[u8],
31090 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31091 let avail_len = __input.len();
31092 let mut payload_buf = [0; Self::ENCODED_LEN];
31093 let mut buf = if avail_len < Self::ENCODED_LEN {
31094 payload_buf[0..avail_len].copy_from_slice(__input);
31095 Bytes::new(&payload_buf)
31096 } else {
31097 Bytes::new(__input)
31098 };
31099 let mut __struct = Self::default();
31100 __struct.time = buf.get_u64_le();
31101 __struct.lat = buf.get_i32_le();
31102 __struct.lon = buf.get_i32_le();
31103 __struct.alt = buf.get_i32_le();
31104 __struct.relative_alt = buf.get_i32_le();
31105 __struct.next_lat = buf.get_i32_le();
31106 __struct.next_lon = buf.get_i32_le();
31107 __struct.next_alt = buf.get_i32_le();
31108 __struct.vx = buf.get_i16_le();
31109 __struct.vy = buf.get_i16_le();
31110 __struct.vz = buf.get_i16_le();
31111 __struct.h_acc = buf.get_u16_le();
31112 __struct.v_acc = buf.get_u16_le();
31113 __struct.vel_acc = buf.get_u16_le();
31114 __struct.update_rate = buf.get_u16_le();
31115 for v in &mut __struct.uas_id {
31116 let val = buf.get_u8();
31117 *v = val;
31118 }
31119 let tmp = buf.get_u8();
31120 __struct.flight_state =
31121 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31122 enum_type: "UtmFlightState",
31123 value: tmp as u64,
31124 })?;
31125 let tmp = buf.get_u8();
31126 __struct.flags = UtmDataAvailFlags::from_bits(tmp as <UtmDataAvailFlags as Flags>::Bits)
31127 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31128 flag_type: "UtmDataAvailFlags",
31129 value: tmp as u64,
31130 })?;
31131 Ok(__struct)
31132 }
31133 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31134 let mut __tmp = BytesMut::new(bytes);
31135 #[allow(clippy::absurd_extreme_comparisons)]
31136 #[allow(unused_comparisons)]
31137 if __tmp.remaining() < Self::ENCODED_LEN {
31138 panic!(
31139 "buffer is too small (need {} bytes, but got {})",
31140 Self::ENCODED_LEN,
31141 __tmp.remaining(),
31142 )
31143 }
31144 __tmp.put_u64_le(self.time);
31145 __tmp.put_i32_le(self.lat);
31146 __tmp.put_i32_le(self.lon);
31147 __tmp.put_i32_le(self.alt);
31148 __tmp.put_i32_le(self.relative_alt);
31149 __tmp.put_i32_le(self.next_lat);
31150 __tmp.put_i32_le(self.next_lon);
31151 __tmp.put_i32_le(self.next_alt);
31152 __tmp.put_i16_le(self.vx);
31153 __tmp.put_i16_le(self.vy);
31154 __tmp.put_i16_le(self.vz);
31155 __tmp.put_u16_le(self.h_acc);
31156 __tmp.put_u16_le(self.v_acc);
31157 __tmp.put_u16_le(self.vel_acc);
31158 __tmp.put_u16_le(self.update_rate);
31159 for val in &self.uas_id {
31160 __tmp.put_u8(*val);
31161 }
31162 __tmp.put_u8(self.flight_state as u8);
31163 __tmp.put_u8(self.flags.bits() as u8);
31164 if matches!(version, MavlinkVersion::V2) {
31165 let len = __tmp.len();
31166 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31167 } else {
31168 __tmp.len()
31169 }
31170 }
31171}
31172#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
31173#[doc = ""]
31174#[doc = "ID: 248"]
31175#[derive(Debug, Clone, PartialEq)]
31176#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31177#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31178#[cfg_attr(feature = "ts", derive(TS))]
31179#[cfg_attr(feature = "ts", ts(export))]
31180pub struct V2_EXTENSION_DATA {
31181 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
31182 pub message_type: u16,
31183 #[doc = "Network ID (0 for broadcast)"]
31184 pub target_network: u8,
31185 #[doc = "System ID (0 for broadcast)"]
31186 pub target_system: u8,
31187 #[doc = "Component ID (0 for broadcast)"]
31188 pub target_component: u8,
31189 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
31190 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31191 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31192 pub payload: [u8; 249],
31193}
31194impl V2_EXTENSION_DATA {
31195 pub const ENCODED_LEN: usize = 254usize;
31196 pub const DEFAULT: Self = Self {
31197 message_type: 0_u16,
31198 target_network: 0_u8,
31199 target_system: 0_u8,
31200 target_component: 0_u8,
31201 payload: [0_u8; 249usize],
31202 };
31203 #[cfg(feature = "arbitrary")]
31204 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31205 use arbitrary::{Arbitrary, Unstructured};
31206 let mut buf = [0u8; 1024];
31207 rng.fill_bytes(&mut buf);
31208 let mut unstructured = Unstructured::new(&buf);
31209 Self::arbitrary(&mut unstructured).unwrap_or_default()
31210 }
31211}
31212impl Default for V2_EXTENSION_DATA {
31213 fn default() -> Self {
31214 Self::DEFAULT.clone()
31215 }
31216}
31217impl MessageData for V2_EXTENSION_DATA {
31218 type Message = MavMessage;
31219 const ID: u32 = 248u32;
31220 const NAME: &'static str = "V2_EXTENSION";
31221 const EXTRA_CRC: u8 = 8u8;
31222 const ENCODED_LEN: usize = 254usize;
31223 fn deser(
31224 _version: MavlinkVersion,
31225 __input: &[u8],
31226 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31227 let avail_len = __input.len();
31228 let mut payload_buf = [0; Self::ENCODED_LEN];
31229 let mut buf = if avail_len < Self::ENCODED_LEN {
31230 payload_buf[0..avail_len].copy_from_slice(__input);
31231 Bytes::new(&payload_buf)
31232 } else {
31233 Bytes::new(__input)
31234 };
31235 let mut __struct = Self::default();
31236 __struct.message_type = buf.get_u16_le();
31237 __struct.target_network = buf.get_u8();
31238 __struct.target_system = buf.get_u8();
31239 __struct.target_component = buf.get_u8();
31240 for v in &mut __struct.payload {
31241 let val = buf.get_u8();
31242 *v = val;
31243 }
31244 Ok(__struct)
31245 }
31246 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31247 let mut __tmp = BytesMut::new(bytes);
31248 #[allow(clippy::absurd_extreme_comparisons)]
31249 #[allow(unused_comparisons)]
31250 if __tmp.remaining() < Self::ENCODED_LEN {
31251 panic!(
31252 "buffer is too small (need {} bytes, but got {})",
31253 Self::ENCODED_LEN,
31254 __tmp.remaining(),
31255 )
31256 }
31257 __tmp.put_u16_le(self.message_type);
31258 __tmp.put_u8(self.target_network);
31259 __tmp.put_u8(self.target_system);
31260 __tmp.put_u8(self.target_component);
31261 for val in &self.payload {
31262 __tmp.put_u8(*val);
31263 }
31264 if matches!(version, MavlinkVersion::V2) {
31265 let len = __tmp.len();
31266 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31267 } else {
31268 __tmp.len()
31269 }
31270 }
31271}
31272#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
31273#[doc = ""]
31274#[doc = "ID: 74"]
31275#[derive(Debug, Clone, PartialEq)]
31276#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31277#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31278#[cfg_attr(feature = "ts", derive(TS))]
31279#[cfg_attr(feature = "ts", ts(export))]
31280pub struct VFR_HUD_DATA {
31281 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
31282 pub airspeed: f32,
31283 #[doc = "Current ground speed."]
31284 pub groundspeed: f32,
31285 #[doc = "Current altitude (MSL)."]
31286 pub alt: f32,
31287 #[doc = "Current climb rate."]
31288 pub climb: f32,
31289 #[doc = "Current heading in compass units (0-360, 0=north)."]
31290 pub heading: i16,
31291 #[doc = "Current throttle setting (0 to 100)."]
31292 pub throttle: u16,
31293}
31294impl VFR_HUD_DATA {
31295 pub const ENCODED_LEN: usize = 20usize;
31296 pub const DEFAULT: Self = Self {
31297 airspeed: 0.0_f32,
31298 groundspeed: 0.0_f32,
31299 alt: 0.0_f32,
31300 climb: 0.0_f32,
31301 heading: 0_i16,
31302 throttle: 0_u16,
31303 };
31304 #[cfg(feature = "arbitrary")]
31305 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31306 use arbitrary::{Arbitrary, Unstructured};
31307 let mut buf = [0u8; 1024];
31308 rng.fill_bytes(&mut buf);
31309 let mut unstructured = Unstructured::new(&buf);
31310 Self::arbitrary(&mut unstructured).unwrap_or_default()
31311 }
31312}
31313impl Default for VFR_HUD_DATA {
31314 fn default() -> Self {
31315 Self::DEFAULT.clone()
31316 }
31317}
31318impl MessageData for VFR_HUD_DATA {
31319 type Message = MavMessage;
31320 const ID: u32 = 74u32;
31321 const NAME: &'static str = "VFR_HUD";
31322 const EXTRA_CRC: u8 = 20u8;
31323 const ENCODED_LEN: usize = 20usize;
31324 fn deser(
31325 _version: MavlinkVersion,
31326 __input: &[u8],
31327 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31328 let avail_len = __input.len();
31329 let mut payload_buf = [0; Self::ENCODED_LEN];
31330 let mut buf = if avail_len < Self::ENCODED_LEN {
31331 payload_buf[0..avail_len].copy_from_slice(__input);
31332 Bytes::new(&payload_buf)
31333 } else {
31334 Bytes::new(__input)
31335 };
31336 let mut __struct = Self::default();
31337 __struct.airspeed = buf.get_f32_le();
31338 __struct.groundspeed = buf.get_f32_le();
31339 __struct.alt = buf.get_f32_le();
31340 __struct.climb = buf.get_f32_le();
31341 __struct.heading = buf.get_i16_le();
31342 __struct.throttle = buf.get_u16_le();
31343 Ok(__struct)
31344 }
31345 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31346 let mut __tmp = BytesMut::new(bytes);
31347 #[allow(clippy::absurd_extreme_comparisons)]
31348 #[allow(unused_comparisons)]
31349 if __tmp.remaining() < Self::ENCODED_LEN {
31350 panic!(
31351 "buffer is too small (need {} bytes, but got {})",
31352 Self::ENCODED_LEN,
31353 __tmp.remaining(),
31354 )
31355 }
31356 __tmp.put_f32_le(self.airspeed);
31357 __tmp.put_f32_le(self.groundspeed);
31358 __tmp.put_f32_le(self.alt);
31359 __tmp.put_f32_le(self.climb);
31360 __tmp.put_i16_le(self.heading);
31361 __tmp.put_u16_le(self.throttle);
31362 if matches!(version, MavlinkVersion::V2) {
31363 let len = __tmp.len();
31364 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31365 } else {
31366 __tmp.len()
31367 }
31368 }
31369}
31370#[doc = "Vibration levels and accelerometer clipping."]
31371#[doc = ""]
31372#[doc = "ID: 241"]
31373#[derive(Debug, Clone, PartialEq)]
31374#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31375#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31376#[cfg_attr(feature = "ts", derive(TS))]
31377#[cfg_attr(feature = "ts", ts(export))]
31378pub struct VIBRATION_DATA {
31379 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31380 pub time_usec: u64,
31381 #[doc = "Vibration levels on X-axis"]
31382 pub vibration_x: f32,
31383 #[doc = "Vibration levels on Y-axis"]
31384 pub vibration_y: f32,
31385 #[doc = "Vibration levels on Z-axis"]
31386 pub vibration_z: f32,
31387 #[doc = "first accelerometer clipping count"]
31388 pub clipping_0: u32,
31389 #[doc = "second accelerometer clipping count"]
31390 pub clipping_1: u32,
31391 #[doc = "third accelerometer clipping count"]
31392 pub clipping_2: u32,
31393}
31394impl VIBRATION_DATA {
31395 pub const ENCODED_LEN: usize = 32usize;
31396 pub const DEFAULT: Self = Self {
31397 time_usec: 0_u64,
31398 vibration_x: 0.0_f32,
31399 vibration_y: 0.0_f32,
31400 vibration_z: 0.0_f32,
31401 clipping_0: 0_u32,
31402 clipping_1: 0_u32,
31403 clipping_2: 0_u32,
31404 };
31405 #[cfg(feature = "arbitrary")]
31406 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31407 use arbitrary::{Arbitrary, Unstructured};
31408 let mut buf = [0u8; 1024];
31409 rng.fill_bytes(&mut buf);
31410 let mut unstructured = Unstructured::new(&buf);
31411 Self::arbitrary(&mut unstructured).unwrap_or_default()
31412 }
31413}
31414impl Default for VIBRATION_DATA {
31415 fn default() -> Self {
31416 Self::DEFAULT.clone()
31417 }
31418}
31419impl MessageData for VIBRATION_DATA {
31420 type Message = MavMessage;
31421 const ID: u32 = 241u32;
31422 const NAME: &'static str = "VIBRATION";
31423 const EXTRA_CRC: u8 = 90u8;
31424 const ENCODED_LEN: usize = 32usize;
31425 fn deser(
31426 _version: MavlinkVersion,
31427 __input: &[u8],
31428 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31429 let avail_len = __input.len();
31430 let mut payload_buf = [0; Self::ENCODED_LEN];
31431 let mut buf = if avail_len < Self::ENCODED_LEN {
31432 payload_buf[0..avail_len].copy_from_slice(__input);
31433 Bytes::new(&payload_buf)
31434 } else {
31435 Bytes::new(__input)
31436 };
31437 let mut __struct = Self::default();
31438 __struct.time_usec = buf.get_u64_le();
31439 __struct.vibration_x = buf.get_f32_le();
31440 __struct.vibration_y = buf.get_f32_le();
31441 __struct.vibration_z = buf.get_f32_le();
31442 __struct.clipping_0 = buf.get_u32_le();
31443 __struct.clipping_1 = buf.get_u32_le();
31444 __struct.clipping_2 = buf.get_u32_le();
31445 Ok(__struct)
31446 }
31447 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31448 let mut __tmp = BytesMut::new(bytes);
31449 #[allow(clippy::absurd_extreme_comparisons)]
31450 #[allow(unused_comparisons)]
31451 if __tmp.remaining() < Self::ENCODED_LEN {
31452 panic!(
31453 "buffer is too small (need {} bytes, but got {})",
31454 Self::ENCODED_LEN,
31455 __tmp.remaining(),
31456 )
31457 }
31458 __tmp.put_u64_le(self.time_usec);
31459 __tmp.put_f32_le(self.vibration_x);
31460 __tmp.put_f32_le(self.vibration_y);
31461 __tmp.put_f32_le(self.vibration_z);
31462 __tmp.put_u32_le(self.clipping_0);
31463 __tmp.put_u32_le(self.clipping_1);
31464 __tmp.put_u32_le(self.clipping_2);
31465 if matches!(version, MavlinkVersion::V2) {
31466 let len = __tmp.len();
31467 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31468 } else {
31469 __tmp.len()
31470 }
31471 }
31472}
31473#[doc = "Global position estimate from a Vicon motion system source."]
31474#[doc = ""]
31475#[doc = "ID: 104"]
31476#[derive(Debug, Clone, PartialEq)]
31477#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31479#[cfg_attr(feature = "ts", derive(TS))]
31480#[cfg_attr(feature = "ts", ts(export))]
31481pub struct VICON_POSITION_ESTIMATE_DATA {
31482 #[doc = "Timestamp (UNIX time or time since system boot)"]
31483 pub usec: u64,
31484 #[doc = "Global X position"]
31485 pub x: f32,
31486 #[doc = "Global Y position"]
31487 pub y: f32,
31488 #[doc = "Global Z position"]
31489 pub z: f32,
31490 #[doc = "Roll angle"]
31491 pub roll: f32,
31492 #[doc = "Pitch angle"]
31493 pub pitch: f32,
31494 #[doc = "Yaw angle"]
31495 pub yaw: f32,
31496 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31497 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31498 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31499 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31500 pub covariance: [f32; 21],
31501}
31502impl VICON_POSITION_ESTIMATE_DATA {
31503 pub const ENCODED_LEN: usize = 116usize;
31504 pub const DEFAULT: Self = Self {
31505 usec: 0_u64,
31506 x: 0.0_f32,
31507 y: 0.0_f32,
31508 z: 0.0_f32,
31509 roll: 0.0_f32,
31510 pitch: 0.0_f32,
31511 yaw: 0.0_f32,
31512 covariance: [0.0_f32; 21usize],
31513 };
31514 #[cfg(feature = "arbitrary")]
31515 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31516 use arbitrary::{Arbitrary, Unstructured};
31517 let mut buf = [0u8; 1024];
31518 rng.fill_bytes(&mut buf);
31519 let mut unstructured = Unstructured::new(&buf);
31520 Self::arbitrary(&mut unstructured).unwrap_or_default()
31521 }
31522}
31523impl Default for VICON_POSITION_ESTIMATE_DATA {
31524 fn default() -> Self {
31525 Self::DEFAULT.clone()
31526 }
31527}
31528impl MessageData for VICON_POSITION_ESTIMATE_DATA {
31529 type Message = MavMessage;
31530 const ID: u32 = 104u32;
31531 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
31532 const EXTRA_CRC: u8 = 56u8;
31533 const ENCODED_LEN: usize = 116usize;
31534 fn deser(
31535 _version: MavlinkVersion,
31536 __input: &[u8],
31537 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31538 let avail_len = __input.len();
31539 let mut payload_buf = [0; Self::ENCODED_LEN];
31540 let mut buf = if avail_len < Self::ENCODED_LEN {
31541 payload_buf[0..avail_len].copy_from_slice(__input);
31542 Bytes::new(&payload_buf)
31543 } else {
31544 Bytes::new(__input)
31545 };
31546 let mut __struct = Self::default();
31547 __struct.usec = buf.get_u64_le();
31548 __struct.x = buf.get_f32_le();
31549 __struct.y = buf.get_f32_le();
31550 __struct.z = buf.get_f32_le();
31551 __struct.roll = buf.get_f32_le();
31552 __struct.pitch = buf.get_f32_le();
31553 __struct.yaw = buf.get_f32_le();
31554 for v in &mut __struct.covariance {
31555 let val = buf.get_f32_le();
31556 *v = val;
31557 }
31558 Ok(__struct)
31559 }
31560 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31561 let mut __tmp = BytesMut::new(bytes);
31562 #[allow(clippy::absurd_extreme_comparisons)]
31563 #[allow(unused_comparisons)]
31564 if __tmp.remaining() < Self::ENCODED_LEN {
31565 panic!(
31566 "buffer is too small (need {} bytes, but got {})",
31567 Self::ENCODED_LEN,
31568 __tmp.remaining(),
31569 )
31570 }
31571 __tmp.put_u64_le(self.usec);
31572 __tmp.put_f32_le(self.x);
31573 __tmp.put_f32_le(self.y);
31574 __tmp.put_f32_le(self.z);
31575 __tmp.put_f32_le(self.roll);
31576 __tmp.put_f32_le(self.pitch);
31577 __tmp.put_f32_le(self.yaw);
31578 if matches!(version, MavlinkVersion::V2) {
31579 for val in &self.covariance {
31580 __tmp.put_f32_le(*val);
31581 }
31582 let len = __tmp.len();
31583 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31584 } else {
31585 __tmp.len()
31586 }
31587 }
31588}
31589#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
31590#[doc = ""]
31591#[doc = "ID: 269"]
31592#[derive(Debug, Clone, PartialEq)]
31593#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31594#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31595#[cfg_attr(feature = "ts", derive(TS))]
31596#[cfg_attr(feature = "ts", ts(export))]
31597pub struct VIDEO_STREAM_INFORMATION_DATA {
31598 #[doc = "Frame rate."]
31599 pub framerate: f32,
31600 #[doc = "Bit rate."]
31601 pub bitrate: u32,
31602 #[doc = "Bitmap of stream status flags."]
31603 pub flags: VideoStreamStatusFlags,
31604 #[doc = "Horizontal resolution."]
31605 pub resolution_h: u16,
31606 #[doc = "Vertical resolution."]
31607 pub resolution_v: u16,
31608 #[doc = "Video image rotation clockwise."]
31609 pub rotation: u16,
31610 #[doc = "Horizontal Field of view."]
31611 pub hfov: u16,
31612 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31613 pub stream_id: u8,
31614 #[doc = "Number of streams available."]
31615 pub count: u8,
31616 #[doc = "Type of stream."]
31617 pub mavtype: VideoStreamType,
31618 #[doc = "Stream name."]
31619 #[cfg_attr(feature = "ts", ts(type = "string"))]
31620 pub name: CharArray<32>,
31621 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
31622 #[cfg_attr(feature = "ts", ts(type = "string"))]
31623 pub uri: CharArray<160>,
31624 #[doc = "Encoding of stream."]
31625 #[cfg_attr(feature = "serde", serde(default))]
31626 pub encoding: VideoStreamEncoding,
31627 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31628 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31629 pub camera_device_id: u8,
31630}
31631impl VIDEO_STREAM_INFORMATION_DATA {
31632 pub const ENCODED_LEN: usize = 215usize;
31633 pub const DEFAULT: Self = Self {
31634 framerate: 0.0_f32,
31635 bitrate: 0_u32,
31636 flags: VideoStreamStatusFlags::DEFAULT,
31637 resolution_h: 0_u16,
31638 resolution_v: 0_u16,
31639 rotation: 0_u16,
31640 hfov: 0_u16,
31641 stream_id: 0_u8,
31642 count: 0_u8,
31643 mavtype: VideoStreamType::DEFAULT,
31644 name: CharArray::new([0_u8; 32usize]),
31645 uri: CharArray::new([0_u8; 160usize]),
31646 encoding: VideoStreamEncoding::DEFAULT,
31647 camera_device_id: 0_u8,
31648 };
31649 #[cfg(feature = "arbitrary")]
31650 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31651 use arbitrary::{Arbitrary, Unstructured};
31652 let mut buf = [0u8; 1024];
31653 rng.fill_bytes(&mut buf);
31654 let mut unstructured = Unstructured::new(&buf);
31655 Self::arbitrary(&mut unstructured).unwrap_or_default()
31656 }
31657}
31658impl Default for VIDEO_STREAM_INFORMATION_DATA {
31659 fn default() -> Self {
31660 Self::DEFAULT.clone()
31661 }
31662}
31663impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
31664 type Message = MavMessage;
31665 const ID: u32 = 269u32;
31666 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
31667 const EXTRA_CRC: u8 = 109u8;
31668 const ENCODED_LEN: usize = 215usize;
31669 fn deser(
31670 _version: MavlinkVersion,
31671 __input: &[u8],
31672 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31673 let avail_len = __input.len();
31674 let mut payload_buf = [0; Self::ENCODED_LEN];
31675 let mut buf = if avail_len < Self::ENCODED_LEN {
31676 payload_buf[0..avail_len].copy_from_slice(__input);
31677 Bytes::new(&payload_buf)
31678 } else {
31679 Bytes::new(__input)
31680 };
31681 let mut __struct = Self::default();
31682 __struct.framerate = buf.get_f32_le();
31683 __struct.bitrate = buf.get_u32_le();
31684 let tmp = buf.get_u16_le();
31685 __struct.flags =
31686 VideoStreamStatusFlags::from_bits(tmp as <VideoStreamStatusFlags as Flags>::Bits)
31687 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31688 flag_type: "VideoStreamStatusFlags",
31689 value: tmp as u64,
31690 })?;
31691 __struct.resolution_h = buf.get_u16_le();
31692 __struct.resolution_v = buf.get_u16_le();
31693 __struct.rotation = buf.get_u16_le();
31694 __struct.hfov = buf.get_u16_le();
31695 __struct.stream_id = buf.get_u8();
31696 __struct.count = buf.get_u8();
31697 let tmp = buf.get_u8();
31698 __struct.mavtype =
31699 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31700 enum_type: "VideoStreamType",
31701 value: tmp as u64,
31702 })?;
31703 let mut tmp = [0_u8; 32usize];
31704 for v in &mut tmp {
31705 *v = buf.get_u8();
31706 }
31707 __struct.name = CharArray::new(tmp);
31708 let mut tmp = [0_u8; 160usize];
31709 for v in &mut tmp {
31710 *v = buf.get_u8();
31711 }
31712 __struct.uri = CharArray::new(tmp);
31713 let tmp = buf.get_u8();
31714 __struct.encoding =
31715 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31716 enum_type: "VideoStreamEncoding",
31717 value: tmp as u64,
31718 })?;
31719 __struct.camera_device_id = buf.get_u8();
31720 Ok(__struct)
31721 }
31722 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31723 let mut __tmp = BytesMut::new(bytes);
31724 #[allow(clippy::absurd_extreme_comparisons)]
31725 #[allow(unused_comparisons)]
31726 if __tmp.remaining() < Self::ENCODED_LEN {
31727 panic!(
31728 "buffer is too small (need {} bytes, but got {})",
31729 Self::ENCODED_LEN,
31730 __tmp.remaining(),
31731 )
31732 }
31733 __tmp.put_f32_le(self.framerate);
31734 __tmp.put_u32_le(self.bitrate);
31735 __tmp.put_u16_le(self.flags.bits() as u16);
31736 __tmp.put_u16_le(self.resolution_h);
31737 __tmp.put_u16_le(self.resolution_v);
31738 __tmp.put_u16_le(self.rotation);
31739 __tmp.put_u16_le(self.hfov);
31740 __tmp.put_u8(self.stream_id);
31741 __tmp.put_u8(self.count);
31742 __tmp.put_u8(self.mavtype as u8);
31743 for val in &self.name {
31744 __tmp.put_u8(*val);
31745 }
31746 for val in &self.uri {
31747 __tmp.put_u8(*val);
31748 }
31749 if matches!(version, MavlinkVersion::V2) {
31750 __tmp.put_u8(self.encoding as u8);
31751 __tmp.put_u8(self.camera_device_id);
31752 let len = __tmp.len();
31753 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31754 } else {
31755 __tmp.len()
31756 }
31757 }
31758}
31759#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
31760#[doc = ""]
31761#[doc = "ID: 270"]
31762#[derive(Debug, Clone, PartialEq)]
31763#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31764#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31765#[cfg_attr(feature = "ts", derive(TS))]
31766#[cfg_attr(feature = "ts", ts(export))]
31767pub struct VIDEO_STREAM_STATUS_DATA {
31768 #[doc = "Frame rate"]
31769 pub framerate: f32,
31770 #[doc = "Bit rate"]
31771 pub bitrate: u32,
31772 #[doc = "Bitmap of stream status flags"]
31773 pub flags: VideoStreamStatusFlags,
31774 #[doc = "Horizontal resolution"]
31775 pub resolution_h: u16,
31776 #[doc = "Vertical resolution"]
31777 pub resolution_v: u16,
31778 #[doc = "Video image rotation clockwise"]
31779 pub rotation: u16,
31780 #[doc = "Horizontal Field of view"]
31781 pub hfov: u16,
31782 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31783 pub stream_id: u8,
31784 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31785 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31786 pub camera_device_id: u8,
31787}
31788impl VIDEO_STREAM_STATUS_DATA {
31789 pub const ENCODED_LEN: usize = 20usize;
31790 pub const DEFAULT: Self = Self {
31791 framerate: 0.0_f32,
31792 bitrate: 0_u32,
31793 flags: VideoStreamStatusFlags::DEFAULT,
31794 resolution_h: 0_u16,
31795 resolution_v: 0_u16,
31796 rotation: 0_u16,
31797 hfov: 0_u16,
31798 stream_id: 0_u8,
31799 camera_device_id: 0_u8,
31800 };
31801 #[cfg(feature = "arbitrary")]
31802 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31803 use arbitrary::{Arbitrary, Unstructured};
31804 let mut buf = [0u8; 1024];
31805 rng.fill_bytes(&mut buf);
31806 let mut unstructured = Unstructured::new(&buf);
31807 Self::arbitrary(&mut unstructured).unwrap_or_default()
31808 }
31809}
31810impl Default for VIDEO_STREAM_STATUS_DATA {
31811 fn default() -> Self {
31812 Self::DEFAULT.clone()
31813 }
31814}
31815impl MessageData for VIDEO_STREAM_STATUS_DATA {
31816 type Message = MavMessage;
31817 const ID: u32 = 270u32;
31818 const NAME: &'static str = "VIDEO_STREAM_STATUS";
31819 const EXTRA_CRC: u8 = 59u8;
31820 const ENCODED_LEN: usize = 20usize;
31821 fn deser(
31822 _version: MavlinkVersion,
31823 __input: &[u8],
31824 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31825 let avail_len = __input.len();
31826 let mut payload_buf = [0; Self::ENCODED_LEN];
31827 let mut buf = if avail_len < Self::ENCODED_LEN {
31828 payload_buf[0..avail_len].copy_from_slice(__input);
31829 Bytes::new(&payload_buf)
31830 } else {
31831 Bytes::new(__input)
31832 };
31833 let mut __struct = Self::default();
31834 __struct.framerate = buf.get_f32_le();
31835 __struct.bitrate = buf.get_u32_le();
31836 let tmp = buf.get_u16_le();
31837 __struct.flags =
31838 VideoStreamStatusFlags::from_bits(tmp as <VideoStreamStatusFlags as Flags>::Bits)
31839 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31840 flag_type: "VideoStreamStatusFlags",
31841 value: tmp as u64,
31842 })?;
31843 __struct.resolution_h = buf.get_u16_le();
31844 __struct.resolution_v = buf.get_u16_le();
31845 __struct.rotation = buf.get_u16_le();
31846 __struct.hfov = buf.get_u16_le();
31847 __struct.stream_id = buf.get_u8();
31848 __struct.camera_device_id = buf.get_u8();
31849 Ok(__struct)
31850 }
31851 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31852 let mut __tmp = BytesMut::new(bytes);
31853 #[allow(clippy::absurd_extreme_comparisons)]
31854 #[allow(unused_comparisons)]
31855 if __tmp.remaining() < Self::ENCODED_LEN {
31856 panic!(
31857 "buffer is too small (need {} bytes, but got {})",
31858 Self::ENCODED_LEN,
31859 __tmp.remaining(),
31860 )
31861 }
31862 __tmp.put_f32_le(self.framerate);
31863 __tmp.put_u32_le(self.bitrate);
31864 __tmp.put_u16_le(self.flags.bits() as u16);
31865 __tmp.put_u16_le(self.resolution_h);
31866 __tmp.put_u16_le(self.resolution_v);
31867 __tmp.put_u16_le(self.rotation);
31868 __tmp.put_u16_le(self.hfov);
31869 __tmp.put_u8(self.stream_id);
31870 if matches!(version, MavlinkVersion::V2) {
31871 __tmp.put_u8(self.camera_device_id);
31872 let len = __tmp.len();
31873 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31874 } else {
31875 __tmp.len()
31876 }
31877 }
31878}
31879#[doc = "Local position/attitude estimate from a vision source."]
31880#[doc = ""]
31881#[doc = "ID: 102"]
31882#[derive(Debug, Clone, PartialEq)]
31883#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31884#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31885#[cfg_attr(feature = "ts", derive(TS))]
31886#[cfg_attr(feature = "ts", ts(export))]
31887pub struct VISION_POSITION_ESTIMATE_DATA {
31888 #[doc = "Timestamp (UNIX time or time since system boot)"]
31889 pub usec: u64,
31890 #[doc = "Local X position"]
31891 pub x: f32,
31892 #[doc = "Local Y position"]
31893 pub y: f32,
31894 #[doc = "Local Z position"]
31895 pub z: f32,
31896 #[doc = "Roll angle"]
31897 pub roll: f32,
31898 #[doc = "Pitch angle"]
31899 pub pitch: f32,
31900 #[doc = "Yaw angle"]
31901 pub yaw: f32,
31902 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31903 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31904 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31905 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31906 pub covariance: [f32; 21],
31907 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31908 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31909 pub reset_counter: u8,
31910}
31911impl VISION_POSITION_ESTIMATE_DATA {
31912 pub const ENCODED_LEN: usize = 117usize;
31913 pub const DEFAULT: Self = Self {
31914 usec: 0_u64,
31915 x: 0.0_f32,
31916 y: 0.0_f32,
31917 z: 0.0_f32,
31918 roll: 0.0_f32,
31919 pitch: 0.0_f32,
31920 yaw: 0.0_f32,
31921 covariance: [0.0_f32; 21usize],
31922 reset_counter: 0_u8,
31923 };
31924 #[cfg(feature = "arbitrary")]
31925 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31926 use arbitrary::{Arbitrary, Unstructured};
31927 let mut buf = [0u8; 1024];
31928 rng.fill_bytes(&mut buf);
31929 let mut unstructured = Unstructured::new(&buf);
31930 Self::arbitrary(&mut unstructured).unwrap_or_default()
31931 }
31932}
31933impl Default for VISION_POSITION_ESTIMATE_DATA {
31934 fn default() -> Self {
31935 Self::DEFAULT.clone()
31936 }
31937}
31938impl MessageData for VISION_POSITION_ESTIMATE_DATA {
31939 type Message = MavMessage;
31940 const ID: u32 = 102u32;
31941 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
31942 const EXTRA_CRC: u8 = 158u8;
31943 const ENCODED_LEN: usize = 117usize;
31944 fn deser(
31945 _version: MavlinkVersion,
31946 __input: &[u8],
31947 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31948 let avail_len = __input.len();
31949 let mut payload_buf = [0; Self::ENCODED_LEN];
31950 let mut buf = if avail_len < Self::ENCODED_LEN {
31951 payload_buf[0..avail_len].copy_from_slice(__input);
31952 Bytes::new(&payload_buf)
31953 } else {
31954 Bytes::new(__input)
31955 };
31956 let mut __struct = Self::default();
31957 __struct.usec = buf.get_u64_le();
31958 __struct.x = buf.get_f32_le();
31959 __struct.y = buf.get_f32_le();
31960 __struct.z = buf.get_f32_le();
31961 __struct.roll = buf.get_f32_le();
31962 __struct.pitch = buf.get_f32_le();
31963 __struct.yaw = buf.get_f32_le();
31964 for v in &mut __struct.covariance {
31965 let val = buf.get_f32_le();
31966 *v = val;
31967 }
31968 __struct.reset_counter = buf.get_u8();
31969 Ok(__struct)
31970 }
31971 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31972 let mut __tmp = BytesMut::new(bytes);
31973 #[allow(clippy::absurd_extreme_comparisons)]
31974 #[allow(unused_comparisons)]
31975 if __tmp.remaining() < Self::ENCODED_LEN {
31976 panic!(
31977 "buffer is too small (need {} bytes, but got {})",
31978 Self::ENCODED_LEN,
31979 __tmp.remaining(),
31980 )
31981 }
31982 __tmp.put_u64_le(self.usec);
31983 __tmp.put_f32_le(self.x);
31984 __tmp.put_f32_le(self.y);
31985 __tmp.put_f32_le(self.z);
31986 __tmp.put_f32_le(self.roll);
31987 __tmp.put_f32_le(self.pitch);
31988 __tmp.put_f32_le(self.yaw);
31989 if matches!(version, MavlinkVersion::V2) {
31990 for val in &self.covariance {
31991 __tmp.put_f32_le(*val);
31992 }
31993 __tmp.put_u8(self.reset_counter);
31994 let len = __tmp.len();
31995 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31996 } else {
31997 __tmp.len()
31998 }
31999 }
32000}
32001#[doc = "Speed estimate from a vision source."]
32002#[doc = ""]
32003#[doc = "ID: 103"]
32004#[derive(Debug, Clone, PartialEq)]
32005#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32006#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32007#[cfg_attr(feature = "ts", derive(TS))]
32008#[cfg_attr(feature = "ts", ts(export))]
32009pub struct VISION_SPEED_ESTIMATE_DATA {
32010 #[doc = "Timestamp (UNIX time or time since system boot)"]
32011 pub usec: u64,
32012 #[doc = "Global X speed"]
32013 pub x: f32,
32014 #[doc = "Global Y speed"]
32015 pub y: f32,
32016 #[doc = "Global Z speed"]
32017 pub z: f32,
32018 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
32019 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32020 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32021 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32022 pub covariance: [f32; 9],
32023 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
32024 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32025 pub reset_counter: u8,
32026}
32027impl VISION_SPEED_ESTIMATE_DATA {
32028 pub const ENCODED_LEN: usize = 57usize;
32029 pub const DEFAULT: Self = Self {
32030 usec: 0_u64,
32031 x: 0.0_f32,
32032 y: 0.0_f32,
32033 z: 0.0_f32,
32034 covariance: [0.0_f32; 9usize],
32035 reset_counter: 0_u8,
32036 };
32037 #[cfg(feature = "arbitrary")]
32038 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32039 use arbitrary::{Arbitrary, Unstructured};
32040 let mut buf = [0u8; 1024];
32041 rng.fill_bytes(&mut buf);
32042 let mut unstructured = Unstructured::new(&buf);
32043 Self::arbitrary(&mut unstructured).unwrap_or_default()
32044 }
32045}
32046impl Default for VISION_SPEED_ESTIMATE_DATA {
32047 fn default() -> Self {
32048 Self::DEFAULT.clone()
32049 }
32050}
32051impl MessageData for VISION_SPEED_ESTIMATE_DATA {
32052 type Message = MavMessage;
32053 const ID: u32 = 103u32;
32054 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
32055 const EXTRA_CRC: u8 = 208u8;
32056 const ENCODED_LEN: usize = 57usize;
32057 fn deser(
32058 _version: MavlinkVersion,
32059 __input: &[u8],
32060 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32061 let avail_len = __input.len();
32062 let mut payload_buf = [0; Self::ENCODED_LEN];
32063 let mut buf = if avail_len < Self::ENCODED_LEN {
32064 payload_buf[0..avail_len].copy_from_slice(__input);
32065 Bytes::new(&payload_buf)
32066 } else {
32067 Bytes::new(__input)
32068 };
32069 let mut __struct = Self::default();
32070 __struct.usec = buf.get_u64_le();
32071 __struct.x = buf.get_f32_le();
32072 __struct.y = buf.get_f32_le();
32073 __struct.z = buf.get_f32_le();
32074 for v in &mut __struct.covariance {
32075 let val = buf.get_f32_le();
32076 *v = val;
32077 }
32078 __struct.reset_counter = buf.get_u8();
32079 Ok(__struct)
32080 }
32081 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32082 let mut __tmp = BytesMut::new(bytes);
32083 #[allow(clippy::absurd_extreme_comparisons)]
32084 #[allow(unused_comparisons)]
32085 if __tmp.remaining() < Self::ENCODED_LEN {
32086 panic!(
32087 "buffer is too small (need {} bytes, but got {})",
32088 Self::ENCODED_LEN,
32089 __tmp.remaining(),
32090 )
32091 }
32092 __tmp.put_u64_le(self.usec);
32093 __tmp.put_f32_le(self.x);
32094 __tmp.put_f32_le(self.y);
32095 __tmp.put_f32_le(self.z);
32096 if matches!(version, MavlinkVersion::V2) {
32097 for val in &self.covariance {
32098 __tmp.put_f32_le(*val);
32099 }
32100 __tmp.put_u8(self.reset_counter);
32101 let len = __tmp.len();
32102 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32103 } else {
32104 __tmp.len()
32105 }
32106 }
32107}
32108#[doc = "Cumulative distance traveled for each reported wheel."]
32109#[doc = ""]
32110#[doc = "ID: 9000"]
32111#[derive(Debug, Clone, PartialEq)]
32112#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32113#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32114#[cfg_attr(feature = "ts", derive(TS))]
32115#[cfg_attr(feature = "ts", ts(export))]
32116pub struct WHEEL_DISTANCE_DATA {
32117 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32118 pub time_usec: u64,
32119 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
32120 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32121 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32122 pub distance: [f64; 16],
32123 #[doc = "Number of wheels reported."]
32124 pub count: u8,
32125}
32126impl WHEEL_DISTANCE_DATA {
32127 pub const ENCODED_LEN: usize = 137usize;
32128 pub const DEFAULT: Self = Self {
32129 time_usec: 0_u64,
32130 distance: [0.0_f64; 16usize],
32131 count: 0_u8,
32132 };
32133 #[cfg(feature = "arbitrary")]
32134 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32135 use arbitrary::{Arbitrary, Unstructured};
32136 let mut buf = [0u8; 1024];
32137 rng.fill_bytes(&mut buf);
32138 let mut unstructured = Unstructured::new(&buf);
32139 Self::arbitrary(&mut unstructured).unwrap_or_default()
32140 }
32141}
32142impl Default for WHEEL_DISTANCE_DATA {
32143 fn default() -> Self {
32144 Self::DEFAULT.clone()
32145 }
32146}
32147impl MessageData for WHEEL_DISTANCE_DATA {
32148 type Message = MavMessage;
32149 const ID: u32 = 9000u32;
32150 const NAME: &'static str = "WHEEL_DISTANCE";
32151 const EXTRA_CRC: u8 = 113u8;
32152 const ENCODED_LEN: usize = 137usize;
32153 fn deser(
32154 _version: MavlinkVersion,
32155 __input: &[u8],
32156 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32157 let avail_len = __input.len();
32158 let mut payload_buf = [0; Self::ENCODED_LEN];
32159 let mut buf = if avail_len < Self::ENCODED_LEN {
32160 payload_buf[0..avail_len].copy_from_slice(__input);
32161 Bytes::new(&payload_buf)
32162 } else {
32163 Bytes::new(__input)
32164 };
32165 let mut __struct = Self::default();
32166 __struct.time_usec = buf.get_u64_le();
32167 for v in &mut __struct.distance {
32168 let val = buf.get_f64_le();
32169 *v = val;
32170 }
32171 __struct.count = buf.get_u8();
32172 Ok(__struct)
32173 }
32174 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32175 let mut __tmp = BytesMut::new(bytes);
32176 #[allow(clippy::absurd_extreme_comparisons)]
32177 #[allow(unused_comparisons)]
32178 if __tmp.remaining() < Self::ENCODED_LEN {
32179 panic!(
32180 "buffer is too small (need {} bytes, but got {})",
32181 Self::ENCODED_LEN,
32182 __tmp.remaining(),
32183 )
32184 }
32185 __tmp.put_u64_le(self.time_usec);
32186 for val in &self.distance {
32187 __tmp.put_f64_le(*val);
32188 }
32189 __tmp.put_u8(self.count);
32190 if matches!(version, MavlinkVersion::V2) {
32191 let len = __tmp.len();
32192 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32193 } else {
32194 __tmp.len()
32195 }
32196 }
32197}
32198#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32199#[doc = ""]
32200#[doc = "ID: 299"]
32201#[derive(Debug, Clone, PartialEq)]
32202#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32203#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32204#[cfg_attr(feature = "ts", derive(TS))]
32205#[cfg_attr(feature = "ts", ts(export))]
32206pub struct WIFI_CONFIG_AP_DATA {
32207 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
32208 #[cfg_attr(feature = "ts", ts(type = "string"))]
32209 pub ssid: CharArray<32>,
32210 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
32211 #[cfg_attr(feature = "ts", ts(type = "string"))]
32212 pub password: CharArray<64>,
32213 #[doc = "WiFi Mode."]
32214 #[cfg_attr(feature = "serde", serde(default))]
32215 pub mode: WifiConfigApMode,
32216 #[doc = "Message acceptance response (sent back to GS)."]
32217 #[cfg_attr(feature = "serde", serde(default))]
32218 pub response: WifiConfigApResponse,
32219}
32220impl WIFI_CONFIG_AP_DATA {
32221 pub const ENCODED_LEN: usize = 98usize;
32222 pub const DEFAULT: Self = Self {
32223 ssid: CharArray::new([0_u8; 32usize]),
32224 password: CharArray::new([0_u8; 64usize]),
32225 mode: WifiConfigApMode::DEFAULT,
32226 response: WifiConfigApResponse::DEFAULT,
32227 };
32228 #[cfg(feature = "arbitrary")]
32229 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32230 use arbitrary::{Arbitrary, Unstructured};
32231 let mut buf = [0u8; 1024];
32232 rng.fill_bytes(&mut buf);
32233 let mut unstructured = Unstructured::new(&buf);
32234 Self::arbitrary(&mut unstructured).unwrap_or_default()
32235 }
32236}
32237impl Default for WIFI_CONFIG_AP_DATA {
32238 fn default() -> Self {
32239 Self::DEFAULT.clone()
32240 }
32241}
32242impl MessageData for WIFI_CONFIG_AP_DATA {
32243 type Message = MavMessage;
32244 const ID: u32 = 299u32;
32245 const NAME: &'static str = "WIFI_CONFIG_AP";
32246 const EXTRA_CRC: u8 = 19u8;
32247 const ENCODED_LEN: usize = 98usize;
32248 fn deser(
32249 _version: MavlinkVersion,
32250 __input: &[u8],
32251 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32252 let avail_len = __input.len();
32253 let mut payload_buf = [0; Self::ENCODED_LEN];
32254 let mut buf = if avail_len < Self::ENCODED_LEN {
32255 payload_buf[0..avail_len].copy_from_slice(__input);
32256 Bytes::new(&payload_buf)
32257 } else {
32258 Bytes::new(__input)
32259 };
32260 let mut __struct = Self::default();
32261 let mut tmp = [0_u8; 32usize];
32262 for v in &mut tmp {
32263 *v = buf.get_u8();
32264 }
32265 __struct.ssid = CharArray::new(tmp);
32266 let mut tmp = [0_u8; 64usize];
32267 for v in &mut tmp {
32268 *v = buf.get_u8();
32269 }
32270 __struct.password = CharArray::new(tmp);
32271 let tmp = buf.get_i8();
32272 __struct.mode =
32273 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32274 enum_type: "WifiConfigApMode",
32275 value: tmp as u64,
32276 })?;
32277 let tmp = buf.get_i8();
32278 __struct.response =
32279 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32280 enum_type: "WifiConfigApResponse",
32281 value: tmp as u64,
32282 })?;
32283 Ok(__struct)
32284 }
32285 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32286 let mut __tmp = BytesMut::new(bytes);
32287 #[allow(clippy::absurd_extreme_comparisons)]
32288 #[allow(unused_comparisons)]
32289 if __tmp.remaining() < Self::ENCODED_LEN {
32290 panic!(
32291 "buffer is too small (need {} bytes, but got {})",
32292 Self::ENCODED_LEN,
32293 __tmp.remaining(),
32294 )
32295 }
32296 for val in &self.ssid {
32297 __tmp.put_u8(*val);
32298 }
32299 for val in &self.password {
32300 __tmp.put_u8(*val);
32301 }
32302 if matches!(version, MavlinkVersion::V2) {
32303 __tmp.put_i8(self.mode as i8);
32304 __tmp.put_i8(self.response as i8);
32305 let len = __tmp.len();
32306 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32307 } else {
32308 __tmp.len()
32309 }
32310 }
32311}
32312#[doc = "Winch status."]
32313#[doc = ""]
32314#[doc = "ID: 9005"]
32315#[derive(Debug, Clone, PartialEq)]
32316#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32317#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32318#[cfg_attr(feature = "ts", derive(TS))]
32319#[cfg_attr(feature = "ts", ts(export))]
32320pub struct WINCH_STATUS_DATA {
32321 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32322 pub time_usec: u64,
32323 #[doc = "Length of line released. NaN if unknown"]
32324 pub line_length: f32,
32325 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
32326 pub speed: f32,
32327 #[doc = "Tension on the line. NaN if unknown"]
32328 pub tension: f32,
32329 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
32330 pub voltage: f32,
32331 #[doc = "Current draw from the winch. NaN if unknown"]
32332 pub current: f32,
32333 #[doc = "Status flags"]
32334 pub status: MavWinchStatusFlag,
32335 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
32336 pub temperature: i16,
32337}
32338impl WINCH_STATUS_DATA {
32339 pub const ENCODED_LEN: usize = 34usize;
32340 pub const DEFAULT: Self = Self {
32341 time_usec: 0_u64,
32342 line_length: 0.0_f32,
32343 speed: 0.0_f32,
32344 tension: 0.0_f32,
32345 voltage: 0.0_f32,
32346 current: 0.0_f32,
32347 status: MavWinchStatusFlag::DEFAULT,
32348 temperature: 0_i16,
32349 };
32350 #[cfg(feature = "arbitrary")]
32351 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32352 use arbitrary::{Arbitrary, Unstructured};
32353 let mut buf = [0u8; 1024];
32354 rng.fill_bytes(&mut buf);
32355 let mut unstructured = Unstructured::new(&buf);
32356 Self::arbitrary(&mut unstructured).unwrap_or_default()
32357 }
32358}
32359impl Default for WINCH_STATUS_DATA {
32360 fn default() -> Self {
32361 Self::DEFAULT.clone()
32362 }
32363}
32364impl MessageData for WINCH_STATUS_DATA {
32365 type Message = MavMessage;
32366 const ID: u32 = 9005u32;
32367 const NAME: &'static str = "WINCH_STATUS";
32368 const EXTRA_CRC: u8 = 117u8;
32369 const ENCODED_LEN: usize = 34usize;
32370 fn deser(
32371 _version: MavlinkVersion,
32372 __input: &[u8],
32373 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32374 let avail_len = __input.len();
32375 let mut payload_buf = [0; Self::ENCODED_LEN];
32376 let mut buf = if avail_len < Self::ENCODED_LEN {
32377 payload_buf[0..avail_len].copy_from_slice(__input);
32378 Bytes::new(&payload_buf)
32379 } else {
32380 Bytes::new(__input)
32381 };
32382 let mut __struct = Self::default();
32383 __struct.time_usec = buf.get_u64_le();
32384 __struct.line_length = buf.get_f32_le();
32385 __struct.speed = buf.get_f32_le();
32386 __struct.tension = buf.get_f32_le();
32387 __struct.voltage = buf.get_f32_le();
32388 __struct.current = buf.get_f32_le();
32389 let tmp = buf.get_u32_le();
32390 __struct.status = MavWinchStatusFlag::from_bits(tmp as <MavWinchStatusFlag as Flags>::Bits)
32391 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32392 flag_type: "MavWinchStatusFlag",
32393 value: tmp as u64,
32394 })?;
32395 __struct.temperature = buf.get_i16_le();
32396 Ok(__struct)
32397 }
32398 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32399 let mut __tmp = BytesMut::new(bytes);
32400 #[allow(clippy::absurd_extreme_comparisons)]
32401 #[allow(unused_comparisons)]
32402 if __tmp.remaining() < Self::ENCODED_LEN {
32403 panic!(
32404 "buffer is too small (need {} bytes, but got {})",
32405 Self::ENCODED_LEN,
32406 __tmp.remaining(),
32407 )
32408 }
32409 __tmp.put_u64_le(self.time_usec);
32410 __tmp.put_f32_le(self.line_length);
32411 __tmp.put_f32_le(self.speed);
32412 __tmp.put_f32_le(self.tension);
32413 __tmp.put_f32_le(self.voltage);
32414 __tmp.put_f32_le(self.current);
32415 __tmp.put_u32_le(self.status.bits() as u32);
32416 __tmp.put_i16_le(self.temperature);
32417 if matches!(version, MavlinkVersion::V2) {
32418 let len = __tmp.len();
32419 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32420 } else {
32421 __tmp.len()
32422 }
32423 }
32424}
32425#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
32426#[doc = ""]
32427#[doc = "ID: 231"]
32428#[derive(Debug, Clone, PartialEq)]
32429#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32430#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32431#[cfg_attr(feature = "ts", derive(TS))]
32432#[cfg_attr(feature = "ts", ts(export))]
32433pub struct WIND_COV_DATA {
32434 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32435 pub time_usec: u64,
32436 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
32437 pub wind_x: f32,
32438 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
32439 pub wind_y: f32,
32440 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
32441 pub wind_z: f32,
32442 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32443 pub var_horiz: f32,
32444 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32445 pub var_vert: f32,
32446 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
32447 pub wind_alt: f32,
32448 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
32449 pub horiz_accuracy: f32,
32450 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
32451 pub vert_accuracy: f32,
32452}
32453impl WIND_COV_DATA {
32454 pub const ENCODED_LEN: usize = 40usize;
32455 pub const DEFAULT: Self = Self {
32456 time_usec: 0_u64,
32457 wind_x: 0.0_f32,
32458 wind_y: 0.0_f32,
32459 wind_z: 0.0_f32,
32460 var_horiz: 0.0_f32,
32461 var_vert: 0.0_f32,
32462 wind_alt: 0.0_f32,
32463 horiz_accuracy: 0.0_f32,
32464 vert_accuracy: 0.0_f32,
32465 };
32466 #[cfg(feature = "arbitrary")]
32467 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32468 use arbitrary::{Arbitrary, Unstructured};
32469 let mut buf = [0u8; 1024];
32470 rng.fill_bytes(&mut buf);
32471 let mut unstructured = Unstructured::new(&buf);
32472 Self::arbitrary(&mut unstructured).unwrap_or_default()
32473 }
32474}
32475impl Default for WIND_COV_DATA {
32476 fn default() -> Self {
32477 Self::DEFAULT.clone()
32478 }
32479}
32480impl MessageData for WIND_COV_DATA {
32481 type Message = MavMessage;
32482 const ID: u32 = 231u32;
32483 const NAME: &'static str = "WIND_COV";
32484 const EXTRA_CRC: u8 = 105u8;
32485 const ENCODED_LEN: usize = 40usize;
32486 fn deser(
32487 _version: MavlinkVersion,
32488 __input: &[u8],
32489 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32490 let avail_len = __input.len();
32491 let mut payload_buf = [0; Self::ENCODED_LEN];
32492 let mut buf = if avail_len < Self::ENCODED_LEN {
32493 payload_buf[0..avail_len].copy_from_slice(__input);
32494 Bytes::new(&payload_buf)
32495 } else {
32496 Bytes::new(__input)
32497 };
32498 let mut __struct = Self::default();
32499 __struct.time_usec = buf.get_u64_le();
32500 __struct.wind_x = buf.get_f32_le();
32501 __struct.wind_y = buf.get_f32_le();
32502 __struct.wind_z = buf.get_f32_le();
32503 __struct.var_horiz = buf.get_f32_le();
32504 __struct.var_vert = buf.get_f32_le();
32505 __struct.wind_alt = buf.get_f32_le();
32506 __struct.horiz_accuracy = buf.get_f32_le();
32507 __struct.vert_accuracy = buf.get_f32_le();
32508 Ok(__struct)
32509 }
32510 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32511 let mut __tmp = BytesMut::new(bytes);
32512 #[allow(clippy::absurd_extreme_comparisons)]
32513 #[allow(unused_comparisons)]
32514 if __tmp.remaining() < Self::ENCODED_LEN {
32515 panic!(
32516 "buffer is too small (need {} bytes, but got {})",
32517 Self::ENCODED_LEN,
32518 __tmp.remaining(),
32519 )
32520 }
32521 __tmp.put_u64_le(self.time_usec);
32522 __tmp.put_f32_le(self.wind_x);
32523 __tmp.put_f32_le(self.wind_y);
32524 __tmp.put_f32_le(self.wind_z);
32525 __tmp.put_f32_le(self.var_horiz);
32526 __tmp.put_f32_le(self.var_vert);
32527 __tmp.put_f32_le(self.wind_alt);
32528 __tmp.put_f32_le(self.horiz_accuracy);
32529 __tmp.put_f32_le(self.vert_accuracy);
32530 if matches!(version, MavlinkVersion::V2) {
32531 let len = __tmp.len();
32532 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32533 } else {
32534 __tmp.len()
32535 }
32536 }
32537}
32538#[derive(Clone, PartialEq, Debug)]
32539#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32540#[cfg_attr(feature = "serde", serde(tag = "type"))]
32541#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32542#[cfg_attr(feature = "ts", derive(TS))]
32543#[cfg_attr(feature = "ts", ts(export))]
32544#[repr(u32)]
32545pub enum MavMessage {
32546 #[doc = "Set the vehicle attitude and body angular rates."]
32547 #[doc = ""]
32548 #[doc = "ID: 140"]
32549 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
32550 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
32551 #[doc = ""]
32552 #[doc = "ID: 375"]
32553 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
32554 #[doc = "The location and information of an ADSB vehicle."]
32555 #[doc = ""]
32556 #[doc = "ID: 246"]
32557 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
32558 #[doc = "The location and information of an AIS vessel."]
32559 #[doc = ""]
32560 #[doc = "ID: 301"]
32561 AIS_VESSEL(AIS_VESSEL_DATA),
32562 #[doc = "The current system altitude."]
32563 #[doc = ""]
32564 #[doc = "ID: 141"]
32565 ALTITUDE(ALTITUDE_DATA),
32566 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
32567 #[doc = ""]
32568 #[doc = "ID: 30"]
32569 ATTITUDE(ATTITUDE_DATA),
32570 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32571 #[doc = ""]
32572 #[doc = "ID: 31"]
32573 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
32574 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32575 #[doc = ""]
32576 #[doc = "ID: 61"]
32577 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
32578 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
32579 #[doc = ""]
32580 #[doc = "ID: 83"]
32581 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
32582 #[doc = "Motion capture attitude and position."]
32583 #[doc = ""]
32584 #[doc = "ID: 138"]
32585 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
32586 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
32587 #[doc = ""]
32588 #[doc = "ID: 7"]
32589 AUTH_KEY(AUTH_KEY_DATA),
32590 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
32591 #[doc = ""]
32592 #[doc = "ID: 286"]
32593 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
32594 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
32595 #[doc = ""]
32596 #[doc = "ID: 148"]
32597 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
32598 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
32599 #[doc = ""]
32600 #[doc = "ID: 435"]
32601 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
32602 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
32603 #[doc = ""]
32604 #[doc = "ID: 437"]
32605 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
32606 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
32607 #[doc = ""]
32608 #[doc = "ID: 372"]
32609 BATTERY_INFO(BATTERY_INFO_DATA),
32610 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
32611 #[doc = ""]
32612 #[doc = "ID: 147"]
32613 BATTERY_STATUS(BATTERY_STATUS_DATA),
32614 #[doc = "Report button state change."]
32615 #[doc = ""]
32616 #[doc = "ID: 257"]
32617 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
32618 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32619 #[doc = ""]
32620 #[doc = "ID: 262"]
32621 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
32622 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32623 #[doc = ""]
32624 #[doc = "ID: 271"]
32625 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
32626 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
32627 #[doc = ""]
32628 #[doc = "ID: 263"]
32629 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
32630 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32631 #[doc = ""]
32632 #[doc = "ID: 259"]
32633 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
32634 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32635 #[doc = ""]
32636 #[doc = "ID: 260"]
32637 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
32638 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
32639 #[doc = ""]
32640 #[doc = "ID: 277"]
32641 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
32642 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
32643 #[doc = ""]
32644 #[doc = "ID: 276"]
32645 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
32646 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
32647 #[doc = ""]
32648 #[doc = "ID: 275"]
32649 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
32650 #[doc = "Camera-IMU triggering and synchronisation message."]
32651 #[doc = ""]
32652 #[doc = "ID: 112"]
32653 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
32654 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
32655 #[doc = ""]
32656 #[doc = "ID: 387"]
32657 CANFD_FRAME(CANFD_FRAME_DATA),
32658 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
32659 #[doc = ""]
32660 #[doc = "ID: 388"]
32661 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
32662 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
32663 #[doc = ""]
32664 #[doc = "ID: 386"]
32665 CAN_FRAME(CAN_FRAME_DATA),
32666 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32667 #[doc = ""]
32668 #[doc = "ID: 336"]
32669 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
32670 #[doc = "Report current used cellular network status."]
32671 #[doc = ""]
32672 #[doc = "ID: 334"]
32673 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
32674 #[doc = "Request to control this MAV."]
32675 #[doc = ""]
32676 #[doc = "ID: 5"]
32677 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
32678 #[doc = "Accept / deny control of this MAV."]
32679 #[doc = ""]
32680 #[doc = "ID: 6"]
32681 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
32682 #[doc = "Information about a potential collision."]
32683 #[doc = ""]
32684 #[doc = "ID: 247"]
32685 COLLISION(COLLISION_DATA),
32686 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32687 #[doc = ""]
32688 #[doc = "ID: 77"]
32689 COMMAND_ACK(COMMAND_ACK_DATA),
32690 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32691 #[doc = ""]
32692 #[doc = "ID: 80"]
32693 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
32694 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32695 #[doc = ""]
32696 #[doc = "ID: 75"]
32697 COMMAND_INT(COMMAND_INT_DATA),
32698 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32699 #[doc = ""]
32700 #[doc = "ID: 76"]
32701 COMMAND_LONG(COMMAND_LONG_DATA),
32702 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
32703 #[doc = ""]
32704 #[doc = "ID: 395"]
32705 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
32706 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
32707 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
32708 #[doc = ""]
32709 #[doc = "ID: 396"]
32710 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
32711 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
32712 #[doc = ""]
32713 #[doc = "ID: 397"]
32714 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
32715 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
32716 #[doc = ""]
32717 #[doc = "ID: 146"]
32718 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
32719 #[doc = "offset response to encapsulated data."]
32720 #[doc = ""]
32721 #[doc = "ID: 50005"]
32722 CUBEPILOT_FIRMWARE_UPDATE_RESP(CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA),
32723 #[doc = "Start firmware update with encapsulated data."]
32724 #[doc = ""]
32725 #[doc = "ID: 50004"]
32726 CUBEPILOT_FIRMWARE_UPDATE_START(CUBEPILOT_FIRMWARE_UPDATE_START_DATA),
32727 #[doc = "Raw RC Data."]
32728 #[doc = ""]
32729 #[doc = "ID: 50001"]
32730 CUBEPILOT_RAW_RC(CUBEPILOT_RAW_RC_DATA),
32731 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
32732 #[doc = ""]
32733 #[doc = "ID: 411"]
32734 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
32735 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
32736 #[doc = ""]
32737 #[doc = "ID: 436"]
32738 CURRENT_MODE(CURRENT_MODE_DATA),
32739 #[doc = "Data stream status information."]
32740 #[doc = ""]
32741 #[doc = "ID: 67"]
32742 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
32743 DATA_STREAM(DATA_STREAM_DATA),
32744 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
32745 #[doc = ""]
32746 #[doc = "ID: 130"]
32747 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
32748 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
32749 #[doc = ""]
32750 #[doc = "ID: 254"]
32751 DEBUG(DEBUG_DATA),
32752 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
32753 #[doc = ""]
32754 #[doc = "ID: 350"]
32755 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
32756 #[doc = "To debug something using a named 3D vector."]
32757 #[doc = ""]
32758 #[doc = "ID: 250"]
32759 DEBUG_VECT(DEBUG_VECT_DATA),
32760 #[doc = "Distance sensor information for an onboard rangefinder."]
32761 #[doc = ""]
32762 #[doc = "ID: 132"]
32763 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
32764 #[doc = "EFI status output."]
32765 #[doc = ""]
32766 #[doc = "ID: 225"]
32767 EFI_STATUS(EFI_STATUS_DATA),
32768 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
32769 #[doc = ""]
32770 #[doc = "ID: 131"]
32771 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
32772 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
32773 #[doc = ""]
32774 #[doc = "ID: 290"]
32775 ESC_INFO(ESC_INFO_DATA),
32776 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
32777 #[doc = ""]
32778 #[doc = "ID: 291"]
32779 ESC_STATUS(ESC_STATUS_DATA),
32780 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
32781 #[doc = ""]
32782 #[doc = "ID: 230"]
32783 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
32784 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
32785 #[doc = ""]
32786 #[doc = "ID: 410"]
32787 EVENT(EVENT_DATA),
32788 #[doc = "Provides state for additional features."]
32789 #[doc = ""]
32790 #[doc = "ID: 245"]
32791 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
32792 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
32793 #[doc = ""]
32794 #[doc = "ID: 162"]
32795 FENCE_STATUS(FENCE_STATUS_DATA),
32796 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
32797 #[doc = ""]
32798 #[doc = "ID: 110"]
32799 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
32800 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
32801 #[doc = ""]
32802 #[doc = "ID: 264"]
32803 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
32804 #[doc = "Current motion information from a designated system."]
32805 #[doc = ""]
32806 #[doc = "ID: 144"]
32807 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
32808 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
32809 #[doc = ""]
32810 #[doc = "ID: 371"]
32811 FUEL_STATUS(FUEL_STATUS_DATA),
32812 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
32813 #[doc = ""]
32814 #[doc = "ID: 373"]
32815 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
32816 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
32817 #[doc = ""]
32818 #[doc = "ID: 285"]
32819 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
32820 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
32821 #[doc = ""]
32822 #[doc = "ID: 283"]
32823 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
32824 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
32825 #[doc = ""]
32826 #[doc = "ID: 284"]
32827 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
32828 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
32829 #[doc = ""]
32830 #[doc = "ID: 280"]
32831 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
32832 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
32833 #[doc = ""]
32834 #[doc = "ID: 282"]
32835 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
32836 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
32837 #[doc = ""]
32838 #[doc = "ID: 288"]
32839 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
32840 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
32841 #[doc = ""]
32842 #[doc = "ID: 287"]
32843 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
32844 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
32845 #[doc = ""]
32846 #[doc = "ID: 281"]
32847 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
32848 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
32849 #[doc = ""]
32850 #[doc = "ID: 33"]
32851 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
32852 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
32853 #[doc = ""]
32854 #[doc = "ID: 63"]
32855 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
32856 #[doc = "Global position/attitude estimate from a vision source."]
32857 #[doc = ""]
32858 #[doc = "ID: 101"]
32859 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
32860 #[doc = "Second GPS data."]
32861 #[doc = ""]
32862 #[doc = "ID: 124"]
32863 GPS2_RAW(GPS2_RAW_DATA),
32864 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
32865 #[doc = ""]
32866 #[doc = "ID: 128"]
32867 GPS2_RTK(GPS2_RTK_DATA),
32868 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
32869 #[doc = ""]
32870 #[doc = "ID: 49"]
32871 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
32872 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
32873 #[doc = ""]
32874 #[doc = "ID: 123"]
32875 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
32876 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
32877 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
32878 #[doc = ""]
32879 #[doc = "ID: 232"]
32880 GPS_INPUT(GPS_INPUT_DATA),
32881 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
32882 #[doc = ""]
32883 #[doc = "ID: 24"]
32884 GPS_RAW_INT(GPS_RAW_INT_DATA),
32885 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
32886 #[doc = ""]
32887 #[doc = "ID: 233"]
32888 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
32889 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
32890 #[doc = ""]
32891 #[doc = "ID: 127"]
32892 GPS_RTK(GPS_RTK_DATA),
32893 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
32894 #[doc = ""]
32895 #[doc = "ID: 25"]
32896 GPS_STATUS(GPS_STATUS_DATA),
32897 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
32898 #[doc = ""]
32899 #[doc = "ID: 0"]
32900 HEARTBEAT(HEARTBEAT_DATA),
32901 #[doc = "Herelink Telemetry."]
32902 #[doc = ""]
32903 #[doc = "ID: 50003"]
32904 HERELINK_TELEM(HERELINK_TELEM_DATA),
32905 #[doc = "Information about video stream."]
32906 #[doc = ""]
32907 #[doc = "ID: 50002"]
32908 HERELINK_VIDEO_STREAM_INFORMATION(HERELINK_VIDEO_STREAM_INFORMATION_DATA),
32909 #[doc = "The IMU readings in SI units in NED body frame."]
32910 #[doc = ""]
32911 #[doc = "ID: 105"]
32912 HIGHRES_IMU(HIGHRES_IMU_DATA),
32913 #[doc = "Message appropriate for high latency connections like Iridium."]
32914 #[doc = ""]
32915 #[doc = "ID: 234"]
32916 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
32917 HIGH_LATENCY(HIGH_LATENCY_DATA),
32918 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
32919 #[doc = ""]
32920 #[doc = "ID: 235"]
32921 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
32922 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
32923 #[doc = ""]
32924 #[doc = "ID: 93"]
32925 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
32926 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
32927 #[doc = ""]
32928 #[doc = "ID: 91"]
32929 HIL_CONTROLS(HIL_CONTROLS_DATA),
32930 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
32931 #[doc = ""]
32932 #[doc = "ID: 113"]
32933 HIL_GPS(HIL_GPS_DATA),
32934 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
32935 #[doc = ""]
32936 #[doc = "ID: 114"]
32937 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
32938 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
32939 #[doc = ""]
32940 #[doc = "ID: 92"]
32941 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
32942 #[doc = "The IMU readings in SI units in NED body frame."]
32943 #[doc = ""]
32944 #[doc = "ID: 107"]
32945 HIL_SENSOR(HIL_SENSOR_DATA),
32946 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
32947 #[doc = ""]
32948 #[doc = "ID: 90"]
32949 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
32950 HIL_STATE(HIL_STATE_DATA),
32951 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
32952 #[doc = ""]
32953 #[doc = "ID: 115"]
32954 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
32955 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
32956 #[doc = ""]
32957 #[doc = "ID: 242"]
32958 HOME_POSITION(HOME_POSITION_DATA),
32959 #[doc = "Temperature and humidity from hygrometer."]
32960 #[doc = ""]
32961 #[doc = "ID: 12920"]
32962 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
32963 #[doc = "Illuminator status."]
32964 #[doc = ""]
32965 #[doc = "ID: 440"]
32966 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
32967 #[doc = "Status of the Iridium SBD link."]
32968 #[doc = ""]
32969 #[doc = "ID: 335"]
32970 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
32971 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
32972 #[doc = ""]
32973 #[doc = "ID: 149"]
32974 LANDING_TARGET(LANDING_TARGET_DATA),
32975 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
32976 #[doc = ""]
32977 #[doc = "ID: 8"]
32978 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
32979 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32980 #[doc = ""]
32981 #[doc = "ID: 32"]
32982 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
32983 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32984 #[doc = ""]
32985 #[doc = "ID: 64"]
32986 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
32987 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32988 #[doc = ""]
32989 #[doc = "ID: 89"]
32990 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
32991 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
32992 #[doc = ""]
32993 #[doc = "ID: 268"]
32994 LOGGING_ACK(LOGGING_ACK_DATA),
32995 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
32996 #[doc = ""]
32997 #[doc = "ID: 266"]
32998 LOGGING_DATA(LOGGING_DATA_DATA),
32999 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
33000 #[doc = ""]
33001 #[doc = "ID: 267"]
33002 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
33003 #[doc = "Reply to LOG_REQUEST_DATA."]
33004 #[doc = ""]
33005 #[doc = "ID: 120"]
33006 LOG_DATA(LOG_DATA_DATA),
33007 #[doc = "Reply to LOG_REQUEST_LIST."]
33008 #[doc = ""]
33009 #[doc = "ID: 118"]
33010 LOG_ENTRY(LOG_ENTRY_DATA),
33011 #[doc = "Erase all logs."]
33012 #[doc = ""]
33013 #[doc = "ID: 121"]
33014 LOG_ERASE(LOG_ERASE_DATA),
33015 #[doc = "Request a chunk of a log."]
33016 #[doc = ""]
33017 #[doc = "ID: 119"]
33018 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
33019 #[doc = "Stop log transfer and resume normal logging."]
33020 #[doc = ""]
33021 #[doc = "ID: 122"]
33022 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
33023 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
33024 #[doc = ""]
33025 #[doc = "ID: 117"]
33026 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
33027 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
33028 #[doc = ""]
33029 #[doc = "ID: 192"]
33030 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
33031 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
33032 #[doc = ""]
33033 #[doc = "ID: 69"]
33034 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
33035 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
33036 #[doc = ""]
33037 #[doc = "ID: 81"]
33038 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
33039 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33040 #[doc = ""]
33041 #[doc = "ID: 249"]
33042 MEMORY_VECT(MEMORY_VECT_DATA),
33043 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
33044 #[doc = ""]
33045 #[doc = "ID: 244"]
33046 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
33047 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
33048 #[doc = ""]
33049 #[doc = "ID: 47"]
33050 MISSION_ACK(MISSION_ACK_DATA),
33051 #[doc = "Delete all mission items at once."]
33052 #[doc = ""]
33053 #[doc = "ID: 45"]
33054 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
33055 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
33056 #[doc = ""]
33057 #[doc = "ID: 44"]
33058 MISSION_COUNT(MISSION_COUNT_DATA),
33059 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
33060 #[doc = ""]
33061 #[doc = "ID: 42"]
33062 MISSION_CURRENT(MISSION_CURRENT_DATA),
33063 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
33064 #[doc = ""]
33065 #[doc = "ID: 39"]
33066 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
33067 MISSION_ITEM(MISSION_ITEM_DATA),
33068 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
33069 #[doc = ""]
33070 #[doc = "ID: 73"]
33071 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
33072 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
33073 #[doc = ""]
33074 #[doc = "ID: 46"]
33075 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
33076 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
33077 #[doc = ""]
33078 #[doc = "ID: 40"]
33079 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
33080 MISSION_REQUEST(MISSION_REQUEST_DATA),
33081 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
33082 #[doc = ""]
33083 #[doc = "ID: 51"]
33084 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
33085 #[doc = "Request the overall list of mission items from the system/component."]
33086 #[doc = ""]
33087 #[doc = "ID: 43"]
33088 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
33089 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
33090 #[doc = ""]
33091 #[doc = "ID: 37"]
33092 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
33093 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
33094 #[doc = ""]
33095 #[doc = "ID: 41"]
33096 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
33097 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
33098 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
33099 #[doc = ""]
33100 #[doc = "ID: 38"]
33101 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
33102 #[doc = "Orientation of a mount."]
33103 #[doc = ""]
33104 #[doc = "ID: 265"]
33105 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
33106 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
33107 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33108 #[doc = ""]
33109 #[doc = "ID: 251"]
33110 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
33111 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33112 #[doc = ""]
33113 #[doc = "ID: 252"]
33114 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
33115 #[doc = "The state of the navigation and position controller."]
33116 #[doc = ""]
33117 #[doc = "ID: 62"]
33118 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
33119 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
33120 #[doc = ""]
33121 #[doc = "ID: 330"]
33122 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
33123 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
33124 #[doc = ""]
33125 #[doc = "ID: 331"]
33126 ODOMETRY(ODOMETRY_DATA),
33127 #[doc = "Hardware status sent by an onboard computer."]
33128 #[doc = ""]
33129 #[doc = "ID: 390"]
33130 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
33131 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
33132 #[doc = ""]
33133 #[doc = "ID: 12918"]
33134 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
33135 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
33136 #[doc = ""]
33137 #[doc = "ID: 12902"]
33138 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
33139 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
33140 #[doc = ""]
33141 #[doc = "ID: 12900"]
33142 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
33143 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
33144 #[doc = ""]
33145 #[doc = "ID: 12901"]
33146 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
33147 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
33148 #[doc = ""]
33149 #[doc = "ID: 12915"]
33150 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
33151 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
33152 #[doc = ""]
33153 #[doc = "ID: 12905"]
33154 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
33155 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
33156 #[doc = ""]
33157 #[doc = "ID: 12903"]
33158 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
33159 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
33160 #[doc = ""]
33161 #[doc = "ID: 12904"]
33162 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
33163 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
33164 #[doc = ""]
33165 #[doc = "ID: 12919"]
33166 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
33167 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
33168 #[doc = ""]
33169 #[doc = "ID: 100"]
33170 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
33171 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
33172 #[doc = ""]
33173 #[doc = "ID: 106"]
33174 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
33175 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
33176 #[doc = ""]
33177 #[doc = "ID: 360"]
33178 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
33179 #[doc = "Response from a PARAM_EXT_SET message."]
33180 #[doc = ""]
33181 #[doc = "ID: 324"]
33182 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
33183 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
33184 #[doc = ""]
33185 #[doc = "ID: 321"]
33186 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
33187 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
33188 #[doc = ""]
33189 #[doc = "ID: 320"]
33190 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
33191 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
33192 #[doc = ""]
33193 #[doc = "ID: 323"]
33194 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
33195 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
33196 #[doc = ""]
33197 #[doc = "ID: 322"]
33198 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
33199 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
33200 #[doc = ""]
33201 #[doc = "ID: 50"]
33202 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
33203 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33204 #[doc = ""]
33205 #[doc = "ID: 21"]
33206 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
33207 #[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
33208 #[doc = ""]
33209 #[doc = "ID: 20"]
33210 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
33211 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33212 #[doc = ""]
33213 #[doc = "ID: 23"]
33214 PARAM_SET(PARAM_SET_DATA),
33215 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33216 #[doc = ""]
33217 #[doc = "ID: 22"]
33218 PARAM_VALUE(PARAM_VALUE_DATA),
33219 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
33220 #[doc = ""]
33221 #[doc = "ID: 4"]
33222 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
33223 PING(PING_DATA),
33224 #[doc = "Control vehicle tone generation (buzzer)."]
33225 #[doc = ""]
33226 #[doc = "ID: 258"]
33227 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
33228 PLAY_TUNE(PLAY_TUNE_DATA),
33229 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
33230 #[doc = ""]
33231 #[doc = "ID: 400"]
33232 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
33233 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
33234 #[doc = ""]
33235 #[doc = "ID: 87"]
33236 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
33237 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
33238 #[doc = ""]
33239 #[doc = "ID: 85"]
33240 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
33241 #[doc = "Power supply status."]
33242 #[doc = ""]
33243 #[doc = "ID: 125"]
33244 POWER_STATUS(POWER_STATUS_DATA),
33245 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
33246 #[doc = ""]
33247 #[doc = "ID: 300"]
33248 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
33249 #[doc = "Status generated by radio and injected into MAVLink stream."]
33250 #[doc = ""]
33251 #[doc = "ID: 109"]
33252 RADIO_STATUS(RADIO_STATUS_DATA),
33253 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
33254 #[doc = ""]
33255 #[doc = "ID: 27"]
33256 RAW_IMU(RAW_IMU_DATA),
33257 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
33258 #[doc = ""]
33259 #[doc = "ID: 28"]
33260 RAW_PRESSURE(RAW_PRESSURE_DATA),
33261 #[doc = "RPM sensor data message."]
33262 #[doc = ""]
33263 #[doc = "ID: 339"]
33264 RAW_RPM(RAW_RPM_DATA),
33265 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33266 #[doc = ""]
33267 #[doc = "ID: 65"]
33268 RC_CHANNELS(RC_CHANNELS_DATA),
33269 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
33270 #[doc = ""]
33271 #[doc = "ID: 70"]
33272 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
33273 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33274 #[doc = ""]
33275 #[doc = "ID: 35"]
33276 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
33277 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
33278 #[doc = ""]
33279 #[doc = "ID: 34"]
33280 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
33281 #[doc = "Request a data stream."]
33282 #[doc = ""]
33283 #[doc = "ID: 66"]
33284 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
33285 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
33286 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
33287 #[doc = ""]
33288 #[doc = "ID: 412"]
33289 REQUEST_EVENT(REQUEST_EVENT_DATA),
33290 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
33291 #[doc = ""]
33292 #[doc = "ID: 142"]
33293 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
33294 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
33295 #[doc = ""]
33296 #[doc = "ID: 413"]
33297 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
33298 #[doc = "Read out the safety zone the MAV currently assumes."]
33299 #[doc = ""]
33300 #[doc = "ID: 55"]
33301 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
33302 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
33303 #[doc = ""]
33304 #[doc = "ID: 54"]
33305 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
33306 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
33307 #[doc = ""]
33308 #[doc = "ID: 26"]
33309 SCALED_IMU(SCALED_IMU_DATA),
33310 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
33311 #[doc = ""]
33312 #[doc = "ID: 116"]
33313 SCALED_IMU2(SCALED_IMU2_DATA),
33314 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
33315 #[doc = ""]
33316 #[doc = "ID: 129"]
33317 SCALED_IMU3(SCALED_IMU3_DATA),
33318 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
33319 #[doc = ""]
33320 #[doc = "ID: 29"]
33321 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
33322 #[doc = "Barometer readings for 2nd barometer."]
33323 #[doc = ""]
33324 #[doc = "ID: 137"]
33325 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
33326 #[doc = "Barometer readings for 3rd barometer."]
33327 #[doc = ""]
33328 #[doc = "ID: 143"]
33329 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
33330 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
33331 #[doc = ""]
33332 #[doc = "ID: 126"]
33333 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
33334 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
33335 #[doc = ""]
33336 #[doc = "ID: 36"]
33337 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
33338 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
33339 #[doc = ""]
33340 #[doc = "ID: 256"]
33341 SETUP_SIGNING(SETUP_SIGNING_DATA),
33342 #[doc = "Set the vehicle attitude and body angular rates."]
33343 #[doc = ""]
33344 #[doc = "ID: 139"]
33345 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
33346 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
33347 #[doc = ""]
33348 #[doc = "ID: 82"]
33349 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
33350 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
33351 #[doc = ""]
33352 #[doc = "ID: 48"]
33353 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
33354 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
33355 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
33356 #[doc = ""]
33357 #[doc = "ID: 243"]
33358 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
33359 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
33360 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
33361 #[doc = ""]
33362 #[doc = "ID: 11"]
33363 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
33364 SET_MODE(SET_MODE_DATA),
33365 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
33366 #[doc = ""]
33367 #[doc = "ID: 86"]
33368 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
33369 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
33370 #[doc = ""]
33371 #[doc = "ID: 84"]
33372 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
33373 #[doc = "Status of simulation environment, if used."]
33374 #[doc = ""]
33375 #[doc = "ID: 108"]
33376 SIM_STATE(SIM_STATE_DATA),
33377 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
33378 #[doc = ""]
33379 #[doc = "ID: 370"]
33380 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
33381 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
33382 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
33383 #[doc = ""]
33384 #[doc = "ID: 253"]
33385 STATUSTEXT(STATUSTEXT_DATA),
33386 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
33387 #[doc = ""]
33388 #[doc = "ID: 261"]
33389 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
33390 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
33391 #[doc = ""]
33392 #[doc = "ID: 401"]
33393 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
33394 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
33395 #[doc = ""]
33396 #[doc = "ID: 2"]
33397 SYSTEM_TIME(SYSTEM_TIME_DATA),
33398 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
33399 #[doc = ""]
33400 #[doc = "ID: 1"]
33401 SYS_STATUS(SYS_STATUS_DATA),
33402 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
33403 #[doc = ""]
33404 #[doc = "ID: 135"]
33405 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
33406 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33407 #[doc = ""]
33408 #[doc = "ID: 134"]
33409 TERRAIN_DATA(TERRAIN_DATA_DATA),
33410 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33411 #[doc = ""]
33412 #[doc = "ID: 136"]
33413 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
33414 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33415 #[doc = ""]
33416 #[doc = "ID: 133"]
33417 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
33418 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
33419 #[doc = ""]
33420 #[doc = "ID: 111"]
33421 TIMESYNC(TIMESYNC_DATA),
33422 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
33423 #[doc = ""]
33424 #[doc = "ID: 380"]
33425 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
33426 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
33427 #[doc = ""]
33428 #[doc = "ID: 333"]
33429 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
33430 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
33431 #[doc = ""]
33432 #[doc = "ID: 332"]
33433 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
33434 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
33435 #[doc = ""]
33436 #[doc = "ID: 385"]
33437 TUNNEL(TUNNEL_DATA),
33438 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
33439 #[doc = ""]
33440 #[doc = "ID: 311"]
33441 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
33442 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
33443 #[doc = ""]
33444 #[doc = "ID: 310"]
33445 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
33446 #[doc = "The global position resulting from GPS and sensor fusion."]
33447 #[doc = ""]
33448 #[doc = "ID: 340"]
33449 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
33450 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
33451 #[doc = ""]
33452 #[doc = "ID: 248"]
33453 V2_EXTENSION(V2_EXTENSION_DATA),
33454 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
33455 #[doc = ""]
33456 #[doc = "ID: 74"]
33457 VFR_HUD(VFR_HUD_DATA),
33458 #[doc = "Vibration levels and accelerometer clipping."]
33459 #[doc = ""]
33460 #[doc = "ID: 241"]
33461 VIBRATION(VIBRATION_DATA),
33462 #[doc = "Global position estimate from a Vicon motion system source."]
33463 #[doc = ""]
33464 #[doc = "ID: 104"]
33465 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
33466 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
33467 #[doc = ""]
33468 #[doc = "ID: 269"]
33469 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
33470 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
33471 #[doc = ""]
33472 #[doc = "ID: 270"]
33473 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
33474 #[doc = "Local position/attitude estimate from a vision source."]
33475 #[doc = ""]
33476 #[doc = "ID: 102"]
33477 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
33478 #[doc = "Speed estimate from a vision source."]
33479 #[doc = ""]
33480 #[doc = "ID: 103"]
33481 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
33482 #[doc = "Cumulative distance traveled for each reported wheel."]
33483 #[doc = ""]
33484 #[doc = "ID: 9000"]
33485 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
33486 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
33487 #[doc = ""]
33488 #[doc = "ID: 299"]
33489 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
33490 #[doc = "Winch status."]
33491 #[doc = ""]
33492 #[doc = "ID: 9005"]
33493 WINCH_STATUS(WINCH_STATUS_DATA),
33494 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
33495 #[doc = ""]
33496 #[doc = "ID: 231"]
33497 WIND_COV(WIND_COV_DATA),
33498}
33499impl MavMessage {
33500 pub const fn all_ids() -> &'static [u32] {
33501 &[
33502 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
33503 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
33504 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
33505 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
33506 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
33507 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
33508 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
33509 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
33510 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
33511 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
33512 148u32, 149u32, 162u32, 192u32, 225u32, 230u32, 231u32, 232u32, 233u32, 234u32, 235u32,
33513 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32, 249u32, 250u32, 251u32,
33514 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32, 261u32, 262u32, 263u32,
33515 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 275u32, 276u32, 277u32,
33516 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32, 290u32, 291u32,
33517 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32, 323u32, 324u32, 330u32,
33518 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32, 350u32, 360u32, 370u32,
33519 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32, 388u32, 390u32, 395u32,
33520 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32, 435u32, 436u32, 437u32,
33521 440u32, 9000u32, 9005u32, 12900u32, 12901u32, 12902u32, 12903u32, 12904u32, 12905u32,
33522 12915u32, 12918u32, 12919u32, 12920u32, 50001u32, 50002u32, 50003u32, 50004u32,
33523 50005u32,
33524 ]
33525 }
33526}
33527impl Message for MavMessage {
33528 fn parse(
33529 version: MavlinkVersion,
33530 id: u32,
33531 payload: &[u8],
33532 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33533 match id {
33534 ACTUATOR_CONTROL_TARGET_DATA::ID => {
33535 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33536 .map(Self::ACTUATOR_CONTROL_TARGET)
33537 }
33538 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
33539 .map(Self::ACTUATOR_OUTPUT_STATUS),
33540 ADSB_VEHICLE_DATA::ID => {
33541 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
33542 }
33543 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
33544 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
33545 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
33546 ATTITUDE_QUATERNION_DATA::ID => {
33547 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
33548 }
33549 ATTITUDE_QUATERNION_COV_DATA::ID => {
33550 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
33551 .map(Self::ATTITUDE_QUATERNION_COV)
33552 }
33553 ATTITUDE_TARGET_DATA::ID => {
33554 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
33555 }
33556 ATT_POS_MOCAP_DATA::ID => {
33557 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
33558 }
33559 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
33560 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33561 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
33562 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
33563 }
33564 AUTOPILOT_VERSION_DATA::ID => {
33565 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
33566 }
33567 AVAILABLE_MODES_DATA::ID => {
33568 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
33569 }
33570 AVAILABLE_MODES_MONITOR_DATA::ID => {
33571 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
33572 .map(Self::AVAILABLE_MODES_MONITOR)
33573 }
33574 BATTERY_INFO_DATA::ID => {
33575 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
33576 }
33577 BATTERY_STATUS_DATA::ID => {
33578 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
33579 }
33580 BUTTON_CHANGE_DATA::ID => {
33581 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
33582 }
33583 CAMERA_CAPTURE_STATUS_DATA::ID => {
33584 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
33585 }
33586 CAMERA_FOV_STATUS_DATA::ID => {
33587 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
33588 }
33589 CAMERA_IMAGE_CAPTURED_DATA::ID => {
33590 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
33591 }
33592 CAMERA_INFORMATION_DATA::ID => {
33593 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
33594 }
33595 CAMERA_SETTINGS_DATA::ID => {
33596 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
33597 }
33598 CAMERA_THERMAL_RANGE_DATA::ID => {
33599 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
33600 }
33601 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
33602 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
33603 .map(Self::CAMERA_TRACKING_GEO_STATUS)
33604 }
33605 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
33606 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
33607 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
33608 }
33609 CAMERA_TRIGGER_DATA::ID => {
33610 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
33611 }
33612 CANFD_FRAME_DATA::ID => {
33613 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
33614 }
33615 CAN_FILTER_MODIFY_DATA::ID => {
33616 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
33617 }
33618 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
33619 CELLULAR_CONFIG_DATA::ID => {
33620 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
33621 }
33622 CELLULAR_STATUS_DATA::ID => {
33623 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
33624 }
33625 CHANGE_OPERATOR_CONTROL_DATA::ID => {
33626 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
33627 .map(Self::CHANGE_OPERATOR_CONTROL)
33628 }
33629 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
33630 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
33631 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
33632 }
33633 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
33634 COMMAND_ACK_DATA::ID => {
33635 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
33636 }
33637 COMMAND_CANCEL_DATA::ID => {
33638 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
33639 }
33640 COMMAND_INT_DATA::ID => {
33641 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
33642 }
33643 COMMAND_LONG_DATA::ID => {
33644 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
33645 }
33646 COMPONENT_INFORMATION_DATA::ID => {
33647 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
33648 }
33649 COMPONENT_INFORMATION_BASIC_DATA::ID => {
33650 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
33651 .map(Self::COMPONENT_INFORMATION_BASIC)
33652 }
33653 COMPONENT_METADATA_DATA::ID => {
33654 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
33655 }
33656 CONTROL_SYSTEM_STATE_DATA::ID => {
33657 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
33658 }
33659 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => {
33660 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::deser(version, payload)
33661 .map(Self::CUBEPILOT_FIRMWARE_UPDATE_RESP)
33662 }
33663 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
33664 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::deser(version, payload)
33665 .map(Self::CUBEPILOT_FIRMWARE_UPDATE_START)
33666 }
33667 CUBEPILOT_RAW_RC_DATA::ID => {
33668 CUBEPILOT_RAW_RC_DATA::deser(version, payload).map(Self::CUBEPILOT_RAW_RC)
33669 }
33670 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
33671 .map(Self::CURRENT_EVENT_SEQUENCE),
33672 CURRENT_MODE_DATA::ID => {
33673 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
33674 }
33675 DATA_STREAM_DATA::ID => {
33676 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
33677 }
33678 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
33679 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
33680 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
33681 }
33682 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
33683 DEBUG_FLOAT_ARRAY_DATA::ID => {
33684 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
33685 }
33686 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
33687 DISTANCE_SENSOR_DATA::ID => {
33688 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
33689 }
33690 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
33691 ENCAPSULATED_DATA_DATA::ID => {
33692 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
33693 }
33694 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
33695 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
33696 ESTIMATOR_STATUS_DATA::ID => {
33697 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
33698 }
33699 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
33700 EXTENDED_SYS_STATE_DATA::ID => {
33701 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
33702 }
33703 FENCE_STATUS_DATA::ID => {
33704 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
33705 }
33706 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
33707 .map(Self::FILE_TRANSFER_PROTOCOL),
33708 FLIGHT_INFORMATION_DATA::ID => {
33709 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
33710 }
33711 FOLLOW_TARGET_DATA::ID => {
33712 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
33713 }
33714 FUEL_STATUS_DATA::ID => {
33715 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
33716 }
33717 GENERATOR_STATUS_DATA::ID => {
33718 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
33719 }
33720 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
33721 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
33722 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
33723 }
33724 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
33725 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
33726 .map(Self::GIMBAL_DEVICE_INFORMATION)
33727 }
33728 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
33729 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
33730 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
33731 }
33732 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
33733 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
33734 .map(Self::GIMBAL_MANAGER_INFORMATION)
33735 }
33736 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
33737 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
33738 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
33739 }
33740 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33741 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
33742 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
33743 }
33744 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
33745 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
33746 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
33747 }
33748 GIMBAL_MANAGER_STATUS_DATA::ID => {
33749 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
33750 }
33751 GLOBAL_POSITION_INT_DATA::ID => {
33752 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
33753 }
33754 GLOBAL_POSITION_INT_COV_DATA::ID => {
33755 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
33756 .map(Self::GLOBAL_POSITION_INT_COV)
33757 }
33758 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33759 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
33760 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
33761 }
33762 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
33763 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
33764 GPS_GLOBAL_ORIGIN_DATA::ID => {
33765 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
33766 }
33767 GPS_INJECT_DATA_DATA::ID => {
33768 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
33769 }
33770 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
33771 GPS_RAW_INT_DATA::ID => {
33772 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
33773 }
33774 GPS_RTCM_DATA_DATA::ID => {
33775 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
33776 }
33777 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
33778 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
33779 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
33780 HERELINK_TELEM_DATA::ID => {
33781 HERELINK_TELEM_DATA::deser(version, payload).map(Self::HERELINK_TELEM)
33782 }
33783 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
33784 HERELINK_VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
33785 .map(Self::HERELINK_VIDEO_STREAM_INFORMATION)
33786 }
33787 HIGHRES_IMU_DATA::ID => {
33788 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
33789 }
33790 HIGH_LATENCY_DATA::ID => {
33791 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
33792 }
33793 HIGH_LATENCY2_DATA::ID => {
33794 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
33795 }
33796 HIL_ACTUATOR_CONTROLS_DATA::ID => {
33797 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
33798 }
33799 HIL_CONTROLS_DATA::ID => {
33800 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
33801 }
33802 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
33803 HIL_OPTICAL_FLOW_DATA::ID => {
33804 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
33805 }
33806 HIL_RC_INPUTS_RAW_DATA::ID => {
33807 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
33808 }
33809 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
33810 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
33811 HIL_STATE_QUATERNION_DATA::ID => {
33812 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
33813 }
33814 HOME_POSITION_DATA::ID => {
33815 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
33816 }
33817 HYGROMETER_SENSOR_DATA::ID => {
33818 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
33819 }
33820 ILLUMINATOR_STATUS_DATA::ID => {
33821 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
33822 }
33823 ISBD_LINK_STATUS_DATA::ID => {
33824 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
33825 }
33826 LANDING_TARGET_DATA::ID => {
33827 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
33828 }
33829 LINK_NODE_STATUS_DATA::ID => {
33830 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
33831 }
33832 LOCAL_POSITION_NED_DATA::ID => {
33833 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
33834 }
33835 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
33836 .map(Self::LOCAL_POSITION_NED_COV),
33837 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33838 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
33839 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
33840 }
33841 LOGGING_ACK_DATA::ID => {
33842 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
33843 }
33844 LOGGING_DATA_DATA::ID => {
33845 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
33846 }
33847 LOGGING_DATA_ACKED_DATA::ID => {
33848 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
33849 }
33850 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
33851 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
33852 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
33853 LOG_REQUEST_DATA_DATA::ID => {
33854 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
33855 }
33856 LOG_REQUEST_END_DATA::ID => {
33857 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
33858 }
33859 LOG_REQUEST_LIST_DATA::ID => {
33860 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
33861 }
33862 MAG_CAL_REPORT_DATA::ID => {
33863 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
33864 }
33865 MANUAL_CONTROL_DATA::ID => {
33866 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
33867 }
33868 MANUAL_SETPOINT_DATA::ID => {
33869 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
33870 }
33871 MEMORY_VECT_DATA::ID => {
33872 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
33873 }
33874 MESSAGE_INTERVAL_DATA::ID => {
33875 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
33876 }
33877 MISSION_ACK_DATA::ID => {
33878 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
33879 }
33880 MISSION_CLEAR_ALL_DATA::ID => {
33881 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
33882 }
33883 MISSION_COUNT_DATA::ID => {
33884 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
33885 }
33886 MISSION_CURRENT_DATA::ID => {
33887 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
33888 }
33889 MISSION_ITEM_DATA::ID => {
33890 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
33891 }
33892 MISSION_ITEM_INT_DATA::ID => {
33893 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
33894 }
33895 MISSION_ITEM_REACHED_DATA::ID => {
33896 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
33897 }
33898 MISSION_REQUEST_DATA::ID => {
33899 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
33900 }
33901 MISSION_REQUEST_INT_DATA::ID => {
33902 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
33903 }
33904 MISSION_REQUEST_LIST_DATA::ID => {
33905 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
33906 }
33907 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
33908 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
33909 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
33910 }
33911 MISSION_SET_CURRENT_DATA::ID => {
33912 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
33913 }
33914 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
33915 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
33916 .map(Self::MISSION_WRITE_PARTIAL_LIST)
33917 }
33918 MOUNT_ORIENTATION_DATA::ID => {
33919 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
33920 }
33921 NAMED_VALUE_FLOAT_DATA::ID => {
33922 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
33923 }
33924 NAMED_VALUE_INT_DATA::ID => {
33925 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
33926 }
33927 NAV_CONTROLLER_OUTPUT_DATA::ID => {
33928 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
33929 }
33930 OBSTACLE_DISTANCE_DATA::ID => {
33931 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
33932 }
33933 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
33934 ONBOARD_COMPUTER_STATUS_DATA::ID => {
33935 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
33936 .map(Self::ONBOARD_COMPUTER_STATUS)
33937 }
33938 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
33939 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
33940 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
33941 }
33942 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
33943 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
33944 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
33945 }
33946 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
33947 .map(Self::OPEN_DRONE_ID_BASIC_ID),
33948 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
33949 .map(Self::OPEN_DRONE_ID_LOCATION),
33950 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
33951 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
33952 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
33953 }
33954 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
33955 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
33956 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
33957 }
33958 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
33959 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
33960 }
33961 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
33962 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
33963 }
33964 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
33965 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
33966 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
33967 }
33968 OPTICAL_FLOW_DATA::ID => {
33969 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
33970 }
33971 OPTICAL_FLOW_RAD_DATA::ID => {
33972 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
33973 }
33974 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
33975 .map(Self::ORBIT_EXECUTION_STATUS),
33976 PARAM_EXT_ACK_DATA::ID => {
33977 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
33978 }
33979 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
33980 .map(Self::PARAM_EXT_REQUEST_LIST),
33981 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
33982 .map(Self::PARAM_EXT_REQUEST_READ),
33983 PARAM_EXT_SET_DATA::ID => {
33984 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
33985 }
33986 PARAM_EXT_VALUE_DATA::ID => {
33987 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
33988 }
33989 PARAM_MAP_RC_DATA::ID => {
33990 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
33991 }
33992 PARAM_REQUEST_LIST_DATA::ID => {
33993 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
33994 }
33995 PARAM_REQUEST_READ_DATA::ID => {
33996 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
33997 }
33998 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
33999 PARAM_VALUE_DATA::ID => {
34000 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
34001 }
34002 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
34003 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
34004 PLAY_TUNE_V2_DATA::ID => {
34005 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
34006 }
34007 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
34008 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
34009 .map(Self::POSITION_TARGET_GLOBAL_INT)
34010 }
34011 POSITION_TARGET_LOCAL_NED_DATA::ID => {
34012 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
34013 .map(Self::POSITION_TARGET_LOCAL_NED)
34014 }
34015 POWER_STATUS_DATA::ID => {
34016 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
34017 }
34018 PROTOCOL_VERSION_DATA::ID => {
34019 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
34020 }
34021 RADIO_STATUS_DATA::ID => {
34022 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
34023 }
34024 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
34025 RAW_PRESSURE_DATA::ID => {
34026 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
34027 }
34028 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
34029 RC_CHANNELS_DATA::ID => {
34030 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
34031 }
34032 RC_CHANNELS_OVERRIDE_DATA::ID => {
34033 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
34034 }
34035 RC_CHANNELS_RAW_DATA::ID => {
34036 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
34037 }
34038 RC_CHANNELS_SCALED_DATA::ID => {
34039 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
34040 }
34041 REQUEST_DATA_STREAM_DATA::ID => {
34042 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
34043 }
34044 REQUEST_EVENT_DATA::ID => {
34045 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
34046 }
34047 RESOURCE_REQUEST_DATA::ID => {
34048 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
34049 }
34050 RESPONSE_EVENT_ERROR_DATA::ID => {
34051 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
34052 }
34053 SAFETY_ALLOWED_AREA_DATA::ID => {
34054 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
34055 }
34056 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
34057 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
34058 .map(Self::SAFETY_SET_ALLOWED_AREA)
34059 }
34060 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
34061 SCALED_IMU2_DATA::ID => {
34062 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
34063 }
34064 SCALED_IMU3_DATA::ID => {
34065 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
34066 }
34067 SCALED_PRESSURE_DATA::ID => {
34068 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
34069 }
34070 SCALED_PRESSURE2_DATA::ID => {
34071 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
34072 }
34073 SCALED_PRESSURE3_DATA::ID => {
34074 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
34075 }
34076 SERIAL_CONTROL_DATA::ID => {
34077 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
34078 }
34079 SERVO_OUTPUT_RAW_DATA::ID => {
34080 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
34081 }
34082 SETUP_SIGNING_DATA::ID => {
34083 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
34084 }
34085 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
34086 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
34087 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
34088 }
34089 SET_ATTITUDE_TARGET_DATA::ID => {
34090 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
34091 }
34092 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
34093 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
34094 }
34095 SET_HOME_POSITION_DATA::ID => {
34096 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
34097 }
34098 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
34099 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
34100 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
34101 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
34102 }
34103 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
34104 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
34105 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
34106 }
34107 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
34108 SMART_BATTERY_INFO_DATA::ID => {
34109 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
34110 }
34111 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
34112 STORAGE_INFORMATION_DATA::ID => {
34113 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
34114 }
34115 SUPPORTED_TUNES_DATA::ID => {
34116 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
34117 }
34118 SYSTEM_TIME_DATA::ID => {
34119 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
34120 }
34121 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
34122 TERRAIN_CHECK_DATA::ID => {
34123 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
34124 }
34125 TERRAIN_DATA_DATA::ID => {
34126 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
34127 }
34128 TERRAIN_REPORT_DATA::ID => {
34129 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
34130 }
34131 TERRAIN_REQUEST_DATA::ID => {
34132 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
34133 }
34134 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
34135 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
34136 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
34137 .map(Self::TIME_ESTIMATE_TO_TARGET)
34138 }
34139 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34140 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
34141 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
34142 }
34143 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34144 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
34145 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
34146 }
34147 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
34148 UAVCAN_NODE_INFO_DATA::ID => {
34149 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
34150 }
34151 UAVCAN_NODE_STATUS_DATA::ID => {
34152 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
34153 }
34154 UTM_GLOBAL_POSITION_DATA::ID => {
34155 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
34156 }
34157 V2_EXTENSION_DATA::ID => {
34158 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
34159 }
34160 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
34161 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
34162 VICON_POSITION_ESTIMATE_DATA::ID => {
34163 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
34164 .map(Self::VICON_POSITION_ESTIMATE)
34165 }
34166 VIDEO_STREAM_INFORMATION_DATA::ID => {
34167 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
34168 .map(Self::VIDEO_STREAM_INFORMATION)
34169 }
34170 VIDEO_STREAM_STATUS_DATA::ID => {
34171 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
34172 }
34173 VISION_POSITION_ESTIMATE_DATA::ID => {
34174 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
34175 .map(Self::VISION_POSITION_ESTIMATE)
34176 }
34177 VISION_SPEED_ESTIMATE_DATA::ID => {
34178 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
34179 }
34180 WHEEL_DISTANCE_DATA::ID => {
34181 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
34182 }
34183 WIFI_CONFIG_AP_DATA::ID => {
34184 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
34185 }
34186 WINCH_STATUS_DATA::ID => {
34187 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
34188 }
34189 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
34190 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
34191 }
34192 }
34193 fn message_name(&self) -> &'static str {
34194 match self {
34195 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
34196 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
34197 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
34198 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
34199 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
34200 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
34201 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
34202 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
34203 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
34204 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
34205 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
34206 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34207 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
34208 }
34209 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
34210 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
34211 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
34212 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
34213 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
34214 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
34215 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
34216 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
34217 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
34218 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
34219 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
34220 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
34221 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
34222 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
34223 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
34224 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
34225 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
34226 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
34227 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
34228 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
34229 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
34230 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
34231 Self::COLLISION(..) => COLLISION_DATA::NAME,
34232 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
34233 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
34234 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
34235 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
34236 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
34237 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
34238 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
34239 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
34240 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(..) => CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::NAME,
34241 Self::CUBEPILOT_FIRMWARE_UPDATE_START(..) => CUBEPILOT_FIRMWARE_UPDATE_START_DATA::NAME,
34242 Self::CUBEPILOT_RAW_RC(..) => CUBEPILOT_RAW_RC_DATA::NAME,
34243 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
34244 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
34245 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
34246 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
34247 Self::DEBUG(..) => DEBUG_DATA::NAME,
34248 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
34249 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
34250 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
34251 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
34252 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
34253 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
34254 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
34255 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
34256 Self::EVENT(..) => EVENT_DATA::NAME,
34257 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
34258 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
34259 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
34260 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
34261 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
34262 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
34263 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
34264 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
34265 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
34266 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
34267 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
34268 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
34269 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34270 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
34271 }
34272 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
34273 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
34274 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
34275 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
34276 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
34277 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
34278 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
34279 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
34280 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
34281 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
34282 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
34283 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
34284 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
34285 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
34286 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
34287 Self::HERELINK_TELEM(..) => HERELINK_TELEM_DATA::NAME,
34288 Self::HERELINK_VIDEO_STREAM_INFORMATION(..) => {
34289 HERELINK_VIDEO_STREAM_INFORMATION_DATA::NAME
34290 }
34291 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
34292 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
34293 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
34294 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
34295 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
34296 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
34297 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
34298 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
34299 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
34300 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
34301 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
34302 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
34303 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
34304 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
34305 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
34306 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
34307 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
34308 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
34309 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
34310 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34311 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
34312 }
34313 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
34314 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
34315 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
34316 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
34317 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
34318 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
34319 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
34320 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
34321 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
34322 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
34323 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
34324 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
34325 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
34326 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
34327 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
34328 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
34329 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
34330 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
34331 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
34332 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
34333 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
34334 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
34335 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
34336 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
34337 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
34338 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
34339 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
34340 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
34341 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
34342 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
34343 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
34344 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
34345 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
34346 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
34347 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
34348 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
34349 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
34350 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
34351 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
34352 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
34353 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
34354 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
34355 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
34356 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
34357 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
34358 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
34359 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
34360 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
34361 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
34362 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
34363 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
34364 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
34365 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
34366 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
34367 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
34368 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
34369 Self::PING(..) => PING_DATA::NAME,
34370 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
34371 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
34372 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34373 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
34374 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
34375 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
34376 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
34377 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
34378 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
34379 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
34380 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
34381 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
34382 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
34383 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
34384 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
34385 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
34386 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
34387 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
34388 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
34389 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
34390 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
34391 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
34392 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
34393 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
34394 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
34395 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
34396 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
34397 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
34398 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
34399 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
34400 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
34401 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
34402 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
34403 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
34404 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34405 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
34406 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
34407 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
34408 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
34409 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
34410 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
34411 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
34412 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
34413 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
34414 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
34415 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
34416 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
34417 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
34418 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
34419 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
34420 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
34421 }
34422 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34423 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
34424 }
34425 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
34426 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
34427 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
34428 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
34429 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
34430 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
34431 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
34432 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
34433 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
34434 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
34435 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
34436 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
34437 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
34438 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
34439 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
34440 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
34441 }
34442 }
34443 fn message_id(&self) -> u32 {
34444 match self {
34445 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
34446 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
34447 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
34448 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
34449 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
34450 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
34451 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
34452 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
34453 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
34454 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
34455 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
34456 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34457 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
34458 }
34459 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
34460 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
34461 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
34462 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
34463 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
34464 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
34465 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
34466 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
34467 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
34468 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
34469 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
34470 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
34471 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
34472 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
34473 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
34474 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
34475 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
34476 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
34477 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
34478 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
34479 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
34480 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
34481 Self::COLLISION(..) => COLLISION_DATA::ID,
34482 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
34483 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
34484 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
34485 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
34486 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
34487 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
34488 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
34489 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
34490 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(..) => CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID,
34491 Self::CUBEPILOT_FIRMWARE_UPDATE_START(..) => CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID,
34492 Self::CUBEPILOT_RAW_RC(..) => CUBEPILOT_RAW_RC_DATA::ID,
34493 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
34494 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
34495 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
34496 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
34497 Self::DEBUG(..) => DEBUG_DATA::ID,
34498 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
34499 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
34500 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
34501 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
34502 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
34503 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
34504 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
34505 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
34506 Self::EVENT(..) => EVENT_DATA::ID,
34507 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
34508 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
34509 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
34510 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
34511 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
34512 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
34513 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
34514 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
34515 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
34516 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
34517 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
34518 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
34519 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34520 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
34521 }
34522 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
34523 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
34524 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
34525 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
34526 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
34527 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
34528 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
34529 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
34530 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
34531 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
34532 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
34533 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
34534 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
34535 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
34536 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
34537 Self::HERELINK_TELEM(..) => HERELINK_TELEM_DATA::ID,
34538 Self::HERELINK_VIDEO_STREAM_INFORMATION(..) => {
34539 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID
34540 }
34541 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
34542 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
34543 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
34544 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
34545 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
34546 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
34547 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
34548 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
34549 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
34550 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
34551 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
34552 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
34553 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
34554 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
34555 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
34556 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
34557 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
34558 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
34559 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
34560 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34561 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
34562 }
34563 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
34564 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
34565 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
34566 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
34567 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
34568 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
34569 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
34570 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
34571 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
34572 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
34573 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
34574 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
34575 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
34576 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
34577 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
34578 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
34579 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
34580 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
34581 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
34582 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
34583 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
34584 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
34585 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
34586 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
34587 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
34588 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
34589 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
34590 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
34591 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
34592 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
34593 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
34594 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
34595 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
34596 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
34597 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
34598 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
34599 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
34600 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
34601 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
34602 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
34603 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
34604 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
34605 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
34606 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
34607 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
34608 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
34609 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
34610 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
34611 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
34612 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
34613 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
34614 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
34615 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
34616 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
34617 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
34618 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
34619 Self::PING(..) => PING_DATA::ID,
34620 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
34621 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
34622 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
34623 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
34624 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
34625 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
34626 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
34627 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
34628 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
34629 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
34630 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
34631 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
34632 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
34633 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
34634 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
34635 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
34636 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
34637 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
34638 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
34639 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
34640 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
34641 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
34642 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
34643 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
34644 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
34645 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
34646 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
34647 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
34648 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
34649 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
34650 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
34651 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
34652 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
34653 Self::SET_MODE(..) => SET_MODE_DATA::ID,
34654 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
34655 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
34656 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
34657 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
34658 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
34659 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
34660 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
34661 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
34662 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
34663 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
34664 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
34665 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
34666 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
34667 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
34668 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
34669 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
34670 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34671 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
34672 }
34673 Self::TUNNEL(..) => TUNNEL_DATA::ID,
34674 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
34675 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
34676 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
34677 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
34678 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
34679 Self::VIBRATION(..) => VIBRATION_DATA::ID,
34680 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
34681 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
34682 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
34683 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
34684 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
34685 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
34686 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
34687 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
34688 Self::WIND_COV(..) => WIND_COV_DATA::ID,
34689 }
34690 }
34691 fn message_id_from_name(name: &str) -> Option<u32> {
34692 match name {
34693 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
34694 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
34695 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
34696 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
34697 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
34698 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
34699 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
34700 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
34701 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
34702 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
34703 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
34704 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
34705 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
34706 }
34707 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
34708 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
34709 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
34710 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
34711 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
34712 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
34713 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
34714 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
34715 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
34716 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
34717 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
34718 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
34719 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
34720 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
34721 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
34722 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
34723 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
34724 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
34725 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
34726 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
34727 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
34728 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
34729 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
34730 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
34731 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
34732 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
34733 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
34734 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
34735 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
34736 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
34737 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
34738 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::NAME => {
34739 Some(CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID)
34740 }
34741 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::NAME => {
34742 Some(CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID)
34743 }
34744 CUBEPILOT_RAW_RC_DATA::NAME => Some(CUBEPILOT_RAW_RC_DATA::ID),
34745 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
34746 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
34747 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
34748 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
34749 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
34750 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
34751 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
34752 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
34753 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
34754 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
34755 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
34756 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
34757 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
34758 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
34759 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
34760 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
34761 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
34762 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
34763 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
34764 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
34765 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
34766 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
34767 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
34768 }
34769 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
34770 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
34771 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
34772 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
34773 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
34774 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
34775 }
34776 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
34777 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
34778 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
34779 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
34780 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
34781 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
34782 }
34783 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
34784 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
34785 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
34786 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
34787 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
34788 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
34789 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
34790 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
34791 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
34792 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
34793 HERELINK_TELEM_DATA::NAME => Some(HERELINK_TELEM_DATA::ID),
34794 HERELINK_VIDEO_STREAM_INFORMATION_DATA::NAME => {
34795 Some(HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID)
34796 }
34797 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
34798 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
34799 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
34800 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
34801 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
34802 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
34803 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
34804 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
34805 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
34806 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
34807 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
34808 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
34809 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
34810 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
34811 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
34812 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
34813 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
34814 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
34815 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
34816 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
34817 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
34818 }
34819 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
34820 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
34821 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
34822 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
34823 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
34824 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
34825 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
34826 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
34827 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
34828 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
34829 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
34830 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
34831 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
34832 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
34833 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
34834 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
34835 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
34836 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
34837 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
34838 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
34839 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
34840 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
34841 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
34842 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
34843 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
34844 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
34845 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
34846 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
34847 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
34848 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
34849 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
34850 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
34851 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
34852 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
34853 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
34854 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
34855 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
34856 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
34857 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
34858 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
34859 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
34860 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
34861 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
34862 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
34863 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
34864 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
34865 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
34866 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
34867 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
34868 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
34869 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
34870 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
34871 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
34872 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
34873 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
34874 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
34875 PING_DATA::NAME => Some(PING_DATA::ID),
34876 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
34877 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
34878 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
34879 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
34880 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
34881 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
34882 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
34883 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
34884 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
34885 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
34886 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
34887 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
34888 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
34889 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
34890 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
34891 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
34892 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
34893 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
34894 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
34895 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
34896 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
34897 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
34898 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
34899 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
34900 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
34901 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
34902 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
34903 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
34904 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
34905 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
34906 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
34907 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
34908 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
34909 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
34910 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
34911 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
34912 }
34913 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
34914 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
34915 }
34916 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
34917 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
34918 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
34919 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
34920 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
34921 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
34922 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
34923 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
34924 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
34925 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
34926 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
34927 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
34928 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
34929 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
34930 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
34931 }
34932 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
34933 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
34934 }
34935 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
34936 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
34937 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
34938 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
34939 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
34940 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
34941 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
34942 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
34943 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
34944 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
34945 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
34946 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
34947 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
34948 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
34949 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
34950 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
34951 _ => None,
34952 }
34953 }
34954 fn default_message_from_id(id: u32) -> Option<Self> {
34955 match id {
34956 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
34957 ACTUATOR_CONTROL_TARGET_DATA::default(),
34958 )),
34959 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
34960 ACTUATOR_OUTPUT_STATUS_DATA::default(),
34961 )),
34962 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
34963 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
34964 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
34965 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
34966 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
34967 ATTITUDE_QUATERNION_DATA::default(),
34968 )),
34969 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
34970 ATTITUDE_QUATERNION_COV_DATA::default(),
34971 )),
34972 ATTITUDE_TARGET_DATA::ID => {
34973 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
34974 }
34975 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
34976 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
34977 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34978 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
34979 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
34980 ))
34981 }
34982 AUTOPILOT_VERSION_DATA::ID => {
34983 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
34984 }
34985 AVAILABLE_MODES_DATA::ID => {
34986 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
34987 }
34988 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
34989 AVAILABLE_MODES_MONITOR_DATA::default(),
34990 )),
34991 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
34992 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
34993 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
34994 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
34995 CAMERA_CAPTURE_STATUS_DATA::default(),
34996 )),
34997 CAMERA_FOV_STATUS_DATA::ID => {
34998 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
34999 }
35000 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
35001 CAMERA_IMAGE_CAPTURED_DATA::default(),
35002 )),
35003 CAMERA_INFORMATION_DATA::ID => {
35004 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
35005 }
35006 CAMERA_SETTINGS_DATA::ID => {
35007 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
35008 }
35009 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
35010 CAMERA_THERMAL_RANGE_DATA::default(),
35011 )),
35012 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
35013 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
35014 )),
35015 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
35016 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
35017 )),
35018 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
35019 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
35020 CAN_FILTER_MODIFY_DATA::ID => {
35021 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
35022 }
35023 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
35024 CELLULAR_CONFIG_DATA::ID => {
35025 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
35026 }
35027 CELLULAR_STATUS_DATA::ID => {
35028 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
35029 }
35030 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
35031 CHANGE_OPERATOR_CONTROL_DATA::default(),
35032 )),
35033 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
35034 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
35035 )),
35036 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
35037 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
35038 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
35039 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
35040 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
35041 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
35042 COMPONENT_INFORMATION_DATA::default(),
35043 )),
35044 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
35045 COMPONENT_INFORMATION_BASIC_DATA::default(),
35046 )),
35047 COMPONENT_METADATA_DATA::ID => {
35048 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
35049 }
35050 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
35051 CONTROL_SYSTEM_STATE_DATA::default(),
35052 )),
35053 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => Some(Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(
35054 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::default(),
35055 )),
35056 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
35057 Some(Self::CUBEPILOT_FIRMWARE_UPDATE_START(
35058 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::default(),
35059 ))
35060 }
35061 CUBEPILOT_RAW_RC_DATA::ID => {
35062 Some(Self::CUBEPILOT_RAW_RC(CUBEPILOT_RAW_RC_DATA::default()))
35063 }
35064 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
35065 CURRENT_EVENT_SEQUENCE_DATA::default(),
35066 )),
35067 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
35068 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
35069 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
35070 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
35071 )),
35072 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
35073 DEBUG_FLOAT_ARRAY_DATA::ID => {
35074 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
35075 }
35076 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
35077 DISTANCE_SENSOR_DATA::ID => {
35078 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
35079 }
35080 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
35081 ENCAPSULATED_DATA_DATA::ID => {
35082 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
35083 }
35084 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
35085 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
35086 ESTIMATOR_STATUS_DATA::ID => {
35087 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
35088 }
35089 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
35090 EXTENDED_SYS_STATE_DATA::ID => {
35091 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
35092 }
35093 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
35094 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
35095 FILE_TRANSFER_PROTOCOL_DATA::default(),
35096 )),
35097 FLIGHT_INFORMATION_DATA::ID => {
35098 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
35099 }
35100 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
35101 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
35102 GENERATOR_STATUS_DATA::ID => {
35103 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
35104 }
35105 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
35106 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
35107 )),
35108 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
35109 GIMBAL_DEVICE_INFORMATION_DATA::default(),
35110 )),
35111 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
35112 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
35113 )),
35114 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
35115 GIMBAL_MANAGER_INFORMATION_DATA::default(),
35116 )),
35117 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35118 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
35119 )),
35120 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35121 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35122 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
35123 ))
35124 }
35125 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
35126 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
35127 )),
35128 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
35129 GIMBAL_MANAGER_STATUS_DATA::default(),
35130 )),
35131 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
35132 GLOBAL_POSITION_INT_DATA::default(),
35133 )),
35134 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35135 GLOBAL_POSITION_INT_COV_DATA::default(),
35136 )),
35137 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35138 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
35139 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
35140 ))
35141 }
35142 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
35143 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
35144 GPS_GLOBAL_ORIGIN_DATA::ID => {
35145 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
35146 }
35147 GPS_INJECT_DATA_DATA::ID => {
35148 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
35149 }
35150 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
35151 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
35152 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
35153 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
35154 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
35155 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
35156 HERELINK_TELEM_DATA::ID => Some(Self::HERELINK_TELEM(HERELINK_TELEM_DATA::default())),
35157 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
35158 Some(Self::HERELINK_VIDEO_STREAM_INFORMATION(
35159 HERELINK_VIDEO_STREAM_INFORMATION_DATA::default(),
35160 ))
35161 }
35162 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
35163 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
35164 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
35165 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35166 HIL_ACTUATOR_CONTROLS_DATA::default(),
35167 )),
35168 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
35169 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
35170 HIL_OPTICAL_FLOW_DATA::ID => {
35171 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
35172 }
35173 HIL_RC_INPUTS_RAW_DATA::ID => {
35174 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
35175 }
35176 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
35177 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
35178 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35179 HIL_STATE_QUATERNION_DATA::default(),
35180 )),
35181 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
35182 HYGROMETER_SENSOR_DATA::ID => {
35183 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
35184 }
35185 ILLUMINATOR_STATUS_DATA::ID => {
35186 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
35187 }
35188 ISBD_LINK_STATUS_DATA::ID => {
35189 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
35190 }
35191 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
35192 LINK_NODE_STATUS_DATA::ID => {
35193 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
35194 }
35195 LOCAL_POSITION_NED_DATA::ID => {
35196 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
35197 }
35198 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35199 LOCAL_POSITION_NED_COV_DATA::default(),
35200 )),
35201 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35202 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35203 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
35204 ))
35205 }
35206 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
35207 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
35208 LOGGING_DATA_ACKED_DATA::ID => {
35209 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
35210 }
35211 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
35212 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
35213 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
35214 LOG_REQUEST_DATA_DATA::ID => {
35215 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
35216 }
35217 LOG_REQUEST_END_DATA::ID => {
35218 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
35219 }
35220 LOG_REQUEST_LIST_DATA::ID => {
35221 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
35222 }
35223 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
35224 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
35225 MANUAL_SETPOINT_DATA::ID => {
35226 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
35227 }
35228 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
35229 MESSAGE_INTERVAL_DATA::ID => {
35230 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
35231 }
35232 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
35233 MISSION_CLEAR_ALL_DATA::ID => {
35234 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
35235 }
35236 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
35237 MISSION_CURRENT_DATA::ID => {
35238 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
35239 }
35240 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
35241 MISSION_ITEM_INT_DATA::ID => {
35242 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
35243 }
35244 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
35245 MISSION_ITEM_REACHED_DATA::default(),
35246 )),
35247 MISSION_REQUEST_DATA::ID => {
35248 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
35249 }
35250 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
35251 MISSION_REQUEST_INT_DATA::default(),
35252 )),
35253 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
35254 MISSION_REQUEST_LIST_DATA::default(),
35255 )),
35256 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
35257 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
35258 )),
35259 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
35260 MISSION_SET_CURRENT_DATA::default(),
35261 )),
35262 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
35263 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
35264 )),
35265 MOUNT_ORIENTATION_DATA::ID => {
35266 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
35267 }
35268 NAMED_VALUE_FLOAT_DATA::ID => {
35269 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
35270 }
35271 NAMED_VALUE_INT_DATA::ID => {
35272 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
35273 }
35274 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
35275 NAV_CONTROLLER_OUTPUT_DATA::default(),
35276 )),
35277 OBSTACLE_DISTANCE_DATA::ID => {
35278 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
35279 }
35280 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
35281 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
35282 ONBOARD_COMPUTER_STATUS_DATA::default(),
35283 )),
35284 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
35285 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
35286 )),
35287 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
35288 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
35289 )),
35290 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
35291 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
35292 )),
35293 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
35294 OPEN_DRONE_ID_LOCATION_DATA::default(),
35295 )),
35296 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
35297 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
35298 )),
35299 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
35300 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
35301 )),
35302 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
35303 OPEN_DRONE_ID_SELF_ID_DATA::default(),
35304 )),
35305 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
35306 OPEN_DRONE_ID_SYSTEM_DATA::default(),
35307 )),
35308 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
35309 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
35310 )),
35311 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
35312 OPTICAL_FLOW_RAD_DATA::ID => {
35313 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
35314 }
35315 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
35316 ORBIT_EXECUTION_STATUS_DATA::default(),
35317 )),
35318 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
35319 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
35320 PARAM_EXT_REQUEST_LIST_DATA::default(),
35321 )),
35322 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
35323 PARAM_EXT_REQUEST_READ_DATA::default(),
35324 )),
35325 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
35326 PARAM_EXT_VALUE_DATA::ID => {
35327 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
35328 }
35329 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
35330 PARAM_REQUEST_LIST_DATA::ID => {
35331 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
35332 }
35333 PARAM_REQUEST_READ_DATA::ID => {
35334 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
35335 }
35336 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
35337 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
35338 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
35339 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
35340 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
35341 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
35342 POSITION_TARGET_GLOBAL_INT_DATA::default(),
35343 )),
35344 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
35345 POSITION_TARGET_LOCAL_NED_DATA::default(),
35346 )),
35347 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
35348 PROTOCOL_VERSION_DATA::ID => {
35349 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
35350 }
35351 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
35352 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
35353 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
35354 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
35355 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
35356 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35357 RC_CHANNELS_OVERRIDE_DATA::default(),
35358 )),
35359 RC_CHANNELS_RAW_DATA::ID => {
35360 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
35361 }
35362 RC_CHANNELS_SCALED_DATA::ID => {
35363 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
35364 }
35365 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35366 REQUEST_DATA_STREAM_DATA::default(),
35367 )),
35368 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
35369 RESOURCE_REQUEST_DATA::ID => {
35370 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
35371 }
35372 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35373 RESPONSE_EVENT_ERROR_DATA::default(),
35374 )),
35375 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35376 SAFETY_ALLOWED_AREA_DATA::default(),
35377 )),
35378 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35379 SAFETY_SET_ALLOWED_AREA_DATA::default(),
35380 )),
35381 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
35382 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
35383 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
35384 SCALED_PRESSURE_DATA::ID => {
35385 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
35386 }
35387 SCALED_PRESSURE2_DATA::ID => {
35388 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
35389 }
35390 SCALED_PRESSURE3_DATA::ID => {
35391 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
35392 }
35393 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
35394 SERVO_OUTPUT_RAW_DATA::ID => {
35395 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
35396 }
35397 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
35398 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35399 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
35400 )),
35401 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35402 SET_ATTITUDE_TARGET_DATA::default(),
35403 )),
35404 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35405 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
35406 )),
35407 SET_HOME_POSITION_DATA::ID => {
35408 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
35409 }
35410 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
35411 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35412 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
35413 )),
35414 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35415 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
35416 )),
35417 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
35418 SMART_BATTERY_INFO_DATA::ID => {
35419 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
35420 }
35421 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
35422 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35423 STORAGE_INFORMATION_DATA::default(),
35424 )),
35425 SUPPORTED_TUNES_DATA::ID => {
35426 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
35427 }
35428 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
35429 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
35430 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
35431 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
35432 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
35433 TERRAIN_REQUEST_DATA::ID => {
35434 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
35435 }
35436 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
35437 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35438 TIME_ESTIMATE_TO_TARGET_DATA::default(),
35439 )),
35440 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35441 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35442 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
35443 ))
35444 }
35445 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35446 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35447 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
35448 ))
35449 }
35450 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
35451 UAVCAN_NODE_INFO_DATA::ID => {
35452 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
35453 }
35454 UAVCAN_NODE_STATUS_DATA::ID => {
35455 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
35456 }
35457 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35458 UTM_GLOBAL_POSITION_DATA::default(),
35459 )),
35460 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
35461 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
35462 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
35463 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35464 VICON_POSITION_ESTIMATE_DATA::default(),
35465 )),
35466 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35467 VIDEO_STREAM_INFORMATION_DATA::default(),
35468 )),
35469 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35470 VIDEO_STREAM_STATUS_DATA::default(),
35471 )),
35472 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35473 VISION_POSITION_ESTIMATE_DATA::default(),
35474 )),
35475 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
35476 VISION_SPEED_ESTIMATE_DATA::default(),
35477 )),
35478 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
35479 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
35480 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
35481 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
35482 _ => None,
35483 }
35484 }
35485 #[cfg(feature = "arbitrary")]
35486 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
35487 match id {
35488 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
35489 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35490 )),
35491 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
35492 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
35493 )),
35494 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
35495 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
35496 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
35497 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
35498 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
35499 ATTITUDE_QUATERNION_DATA::random(rng),
35500 )),
35501 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
35502 ATTITUDE_QUATERNION_COV_DATA::random(rng),
35503 )),
35504 ATTITUDE_TARGET_DATA::ID => {
35505 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
35506 }
35507 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
35508 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
35509 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35510 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
35511 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
35512 ))
35513 }
35514 AUTOPILOT_VERSION_DATA::ID => {
35515 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
35516 }
35517 AVAILABLE_MODES_DATA::ID => {
35518 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
35519 }
35520 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
35521 AVAILABLE_MODES_MONITOR_DATA::random(rng),
35522 )),
35523 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
35524 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
35525 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
35526 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
35527 CAMERA_CAPTURE_STATUS_DATA::random(rng),
35528 )),
35529 CAMERA_FOV_STATUS_DATA::ID => {
35530 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
35531 }
35532 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
35533 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
35534 )),
35535 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
35536 CAMERA_INFORMATION_DATA::random(rng),
35537 )),
35538 CAMERA_SETTINGS_DATA::ID => {
35539 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
35540 }
35541 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
35542 CAMERA_THERMAL_RANGE_DATA::random(rng),
35543 )),
35544 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
35545 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
35546 )),
35547 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
35548 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
35549 )),
35550 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
35551 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
35552 CAN_FILTER_MODIFY_DATA::ID => {
35553 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
35554 }
35555 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
35556 CELLULAR_CONFIG_DATA::ID => {
35557 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
35558 }
35559 CELLULAR_STATUS_DATA::ID => {
35560 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
35561 }
35562 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
35563 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
35564 )),
35565 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
35566 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
35567 )),
35568 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
35569 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
35570 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
35571 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
35572 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
35573 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
35574 COMPONENT_INFORMATION_DATA::random(rng),
35575 )),
35576 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
35577 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
35578 )),
35579 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
35580 COMPONENT_METADATA_DATA::random(rng),
35581 )),
35582 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
35583 CONTROL_SYSTEM_STATE_DATA::random(rng),
35584 )),
35585 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => Some(Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(
35586 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::random(rng),
35587 )),
35588 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
35589 Some(Self::CUBEPILOT_FIRMWARE_UPDATE_START(
35590 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::random(rng),
35591 ))
35592 }
35593 CUBEPILOT_RAW_RC_DATA::ID => {
35594 Some(Self::CUBEPILOT_RAW_RC(CUBEPILOT_RAW_RC_DATA::random(rng)))
35595 }
35596 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
35597 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
35598 )),
35599 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
35600 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
35601 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
35602 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
35603 )),
35604 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
35605 DEBUG_FLOAT_ARRAY_DATA::ID => {
35606 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
35607 }
35608 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
35609 DISTANCE_SENSOR_DATA::ID => {
35610 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
35611 }
35612 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
35613 ENCAPSULATED_DATA_DATA::ID => {
35614 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
35615 }
35616 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
35617 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
35618 ESTIMATOR_STATUS_DATA::ID => {
35619 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
35620 }
35621 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
35622 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
35623 EXTENDED_SYS_STATE_DATA::random(rng),
35624 )),
35625 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
35626 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
35627 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
35628 )),
35629 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
35630 FLIGHT_INFORMATION_DATA::random(rng),
35631 )),
35632 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
35633 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
35634 GENERATOR_STATUS_DATA::ID => {
35635 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
35636 }
35637 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
35638 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
35639 )),
35640 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
35641 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
35642 )),
35643 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
35644 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
35645 )),
35646 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
35647 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
35648 )),
35649 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35650 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
35651 )),
35652 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35653 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35654 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
35655 ))
35656 }
35657 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
35658 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
35659 )),
35660 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
35661 GIMBAL_MANAGER_STATUS_DATA::random(rng),
35662 )),
35663 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
35664 GLOBAL_POSITION_INT_DATA::random(rng),
35665 )),
35666 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35667 GLOBAL_POSITION_INT_COV_DATA::random(rng),
35668 )),
35669 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35670 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
35671 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
35672 ))
35673 }
35674 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
35675 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
35676 GPS_GLOBAL_ORIGIN_DATA::ID => {
35677 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
35678 }
35679 GPS_INJECT_DATA_DATA::ID => {
35680 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
35681 }
35682 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
35683 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
35684 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
35685 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
35686 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
35687 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
35688 HERELINK_TELEM_DATA::ID => Some(Self::HERELINK_TELEM(HERELINK_TELEM_DATA::random(rng))),
35689 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
35690 Some(Self::HERELINK_VIDEO_STREAM_INFORMATION(
35691 HERELINK_VIDEO_STREAM_INFORMATION_DATA::random(rng),
35692 ))
35693 }
35694 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
35695 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
35696 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
35697 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35698 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
35699 )),
35700 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
35701 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
35702 HIL_OPTICAL_FLOW_DATA::ID => {
35703 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
35704 }
35705 HIL_RC_INPUTS_RAW_DATA::ID => {
35706 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
35707 }
35708 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
35709 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
35710 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35711 HIL_STATE_QUATERNION_DATA::random(rng),
35712 )),
35713 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
35714 HYGROMETER_SENSOR_DATA::ID => {
35715 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
35716 }
35717 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
35718 ILLUMINATOR_STATUS_DATA::random(rng),
35719 )),
35720 ISBD_LINK_STATUS_DATA::ID => {
35721 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
35722 }
35723 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
35724 LINK_NODE_STATUS_DATA::ID => {
35725 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
35726 }
35727 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
35728 LOCAL_POSITION_NED_DATA::random(rng),
35729 )),
35730 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35731 LOCAL_POSITION_NED_COV_DATA::random(rng),
35732 )),
35733 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35734 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35735 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
35736 ))
35737 }
35738 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
35739 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
35740 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
35741 LOGGING_DATA_ACKED_DATA::random(rng),
35742 )),
35743 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
35744 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
35745 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
35746 LOG_REQUEST_DATA_DATA::ID => {
35747 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
35748 }
35749 LOG_REQUEST_END_DATA::ID => {
35750 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
35751 }
35752 LOG_REQUEST_LIST_DATA::ID => {
35753 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
35754 }
35755 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
35756 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
35757 MANUAL_SETPOINT_DATA::ID => {
35758 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
35759 }
35760 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
35761 MESSAGE_INTERVAL_DATA::ID => {
35762 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
35763 }
35764 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
35765 MISSION_CLEAR_ALL_DATA::ID => {
35766 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
35767 }
35768 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
35769 MISSION_CURRENT_DATA::ID => {
35770 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
35771 }
35772 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
35773 MISSION_ITEM_INT_DATA::ID => {
35774 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
35775 }
35776 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
35777 MISSION_ITEM_REACHED_DATA::random(rng),
35778 )),
35779 MISSION_REQUEST_DATA::ID => {
35780 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
35781 }
35782 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
35783 MISSION_REQUEST_INT_DATA::random(rng),
35784 )),
35785 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
35786 MISSION_REQUEST_LIST_DATA::random(rng),
35787 )),
35788 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
35789 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
35790 )),
35791 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
35792 MISSION_SET_CURRENT_DATA::random(rng),
35793 )),
35794 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
35795 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
35796 )),
35797 MOUNT_ORIENTATION_DATA::ID => {
35798 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
35799 }
35800 NAMED_VALUE_FLOAT_DATA::ID => {
35801 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
35802 }
35803 NAMED_VALUE_INT_DATA::ID => {
35804 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
35805 }
35806 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
35807 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
35808 )),
35809 OBSTACLE_DISTANCE_DATA::ID => {
35810 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
35811 }
35812 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
35813 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
35814 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
35815 )),
35816 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
35817 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
35818 )),
35819 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
35820 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
35821 )),
35822 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
35823 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
35824 )),
35825 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
35826 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
35827 )),
35828 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
35829 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
35830 )),
35831 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
35832 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
35833 )),
35834 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
35835 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
35836 )),
35837 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
35838 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
35839 )),
35840 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
35841 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
35842 )),
35843 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
35844 OPTICAL_FLOW_RAD_DATA::ID => {
35845 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
35846 }
35847 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
35848 ORBIT_EXECUTION_STATUS_DATA::random(rng),
35849 )),
35850 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
35851 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
35852 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
35853 )),
35854 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
35855 PARAM_EXT_REQUEST_READ_DATA::random(rng),
35856 )),
35857 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
35858 PARAM_EXT_VALUE_DATA::ID => {
35859 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
35860 }
35861 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
35862 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
35863 PARAM_REQUEST_LIST_DATA::random(rng),
35864 )),
35865 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
35866 PARAM_REQUEST_READ_DATA::random(rng),
35867 )),
35868 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
35869 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
35870 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
35871 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
35872 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
35873 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
35874 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35875 )),
35876 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
35877 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35878 )),
35879 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
35880 PROTOCOL_VERSION_DATA::ID => {
35881 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
35882 }
35883 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
35884 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
35885 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
35886 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
35887 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
35888 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35889 RC_CHANNELS_OVERRIDE_DATA::random(rng),
35890 )),
35891 RC_CHANNELS_RAW_DATA::ID => {
35892 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
35893 }
35894 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
35895 RC_CHANNELS_SCALED_DATA::random(rng),
35896 )),
35897 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35898 REQUEST_DATA_STREAM_DATA::random(rng),
35899 )),
35900 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
35901 RESOURCE_REQUEST_DATA::ID => {
35902 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
35903 }
35904 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35905 RESPONSE_EVENT_ERROR_DATA::random(rng),
35906 )),
35907 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35908 SAFETY_ALLOWED_AREA_DATA::random(rng),
35909 )),
35910 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35911 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
35912 )),
35913 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
35914 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
35915 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
35916 SCALED_PRESSURE_DATA::ID => {
35917 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
35918 }
35919 SCALED_PRESSURE2_DATA::ID => {
35920 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
35921 }
35922 SCALED_PRESSURE3_DATA::ID => {
35923 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
35924 }
35925 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
35926 SERVO_OUTPUT_RAW_DATA::ID => {
35927 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
35928 }
35929 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
35930 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35931 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35932 )),
35933 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35934 SET_ATTITUDE_TARGET_DATA::random(rng),
35935 )),
35936 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35937 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
35938 )),
35939 SET_HOME_POSITION_DATA::ID => {
35940 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
35941 }
35942 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
35943 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35944 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35945 )),
35946 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35947 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35948 )),
35949 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
35950 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
35951 SMART_BATTERY_INFO_DATA::random(rng),
35952 )),
35953 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
35954 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35955 STORAGE_INFORMATION_DATA::random(rng),
35956 )),
35957 SUPPORTED_TUNES_DATA::ID => {
35958 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
35959 }
35960 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
35961 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
35962 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
35963 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
35964 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
35965 TERRAIN_REQUEST_DATA::ID => {
35966 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
35967 }
35968 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
35969 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35970 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
35971 )),
35972 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35973 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35974 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
35975 ))
35976 }
35977 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35978 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35979 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
35980 ))
35981 }
35982 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
35983 UAVCAN_NODE_INFO_DATA::ID => {
35984 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
35985 }
35986 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
35987 UAVCAN_NODE_STATUS_DATA::random(rng),
35988 )),
35989 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35990 UTM_GLOBAL_POSITION_DATA::random(rng),
35991 )),
35992 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
35993 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
35994 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
35995 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35996 VICON_POSITION_ESTIMATE_DATA::random(rng),
35997 )),
35998 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35999 VIDEO_STREAM_INFORMATION_DATA::random(rng),
36000 )),
36001 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
36002 VIDEO_STREAM_STATUS_DATA::random(rng),
36003 )),
36004 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
36005 VISION_POSITION_ESTIMATE_DATA::random(rng),
36006 )),
36007 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
36008 VISION_SPEED_ESTIMATE_DATA::random(rng),
36009 )),
36010 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
36011 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
36012 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
36013 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
36014 _ => None,
36015 }
36016 }
36017 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
36018 match self {
36019 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
36020 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
36021 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
36022 Self::AIS_VESSEL(body) => body.ser(version, bytes),
36023 Self::ALTITUDE(body) => body.ser(version, bytes),
36024 Self::ATTITUDE(body) => body.ser(version, bytes),
36025 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
36026 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
36027 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
36028 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
36029 Self::AUTH_KEY(body) => body.ser(version, bytes),
36030 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
36031 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
36032 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
36033 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
36034 Self::BATTERY_INFO(body) => body.ser(version, bytes),
36035 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
36036 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
36037 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
36038 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
36039 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
36040 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
36041 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
36042 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
36043 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
36044 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
36045 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
36046 Self::CANFD_FRAME(body) => body.ser(version, bytes),
36047 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
36048 Self::CAN_FRAME(body) => body.ser(version, bytes),
36049 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
36050 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
36051 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
36052 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
36053 Self::COLLISION(body) => body.ser(version, bytes),
36054 Self::COMMAND_ACK(body) => body.ser(version, bytes),
36055 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
36056 Self::COMMAND_INT(body) => body.ser(version, bytes),
36057 Self::COMMAND_LONG(body) => body.ser(version, bytes),
36058 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
36059 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
36060 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
36061 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
36062 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(body) => body.ser(version, bytes),
36063 Self::CUBEPILOT_FIRMWARE_UPDATE_START(body) => body.ser(version, bytes),
36064 Self::CUBEPILOT_RAW_RC(body) => body.ser(version, bytes),
36065 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
36066 Self::CURRENT_MODE(body) => body.ser(version, bytes),
36067 Self::DATA_STREAM(body) => body.ser(version, bytes),
36068 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
36069 Self::DEBUG(body) => body.ser(version, bytes),
36070 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
36071 Self::DEBUG_VECT(body) => body.ser(version, bytes),
36072 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
36073 Self::EFI_STATUS(body) => body.ser(version, bytes),
36074 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
36075 Self::ESC_INFO(body) => body.ser(version, bytes),
36076 Self::ESC_STATUS(body) => body.ser(version, bytes),
36077 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
36078 Self::EVENT(body) => body.ser(version, bytes),
36079 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
36080 Self::FENCE_STATUS(body) => body.ser(version, bytes),
36081 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
36082 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
36083 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
36084 Self::FUEL_STATUS(body) => body.ser(version, bytes),
36085 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
36086 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
36087 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
36088 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
36089 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
36090 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
36091 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
36092 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
36093 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
36094 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
36095 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
36096 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36097 Self::GPS2_RAW(body) => body.ser(version, bytes),
36098 Self::GPS2_RTK(body) => body.ser(version, bytes),
36099 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
36100 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
36101 Self::GPS_INPUT(body) => body.ser(version, bytes),
36102 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
36103 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
36104 Self::GPS_RTK(body) => body.ser(version, bytes),
36105 Self::GPS_STATUS(body) => body.ser(version, bytes),
36106 Self::HEARTBEAT(body) => body.ser(version, bytes),
36107 Self::HERELINK_TELEM(body) => body.ser(version, bytes),
36108 Self::HERELINK_VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
36109 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
36110 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
36111 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
36112 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
36113 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
36114 Self::HIL_GPS(body) => body.ser(version, bytes),
36115 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
36116 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
36117 Self::HIL_SENSOR(body) => body.ser(version, bytes),
36118 Self::HIL_STATE(body) => body.ser(version, bytes),
36119 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
36120 Self::HOME_POSITION(body) => body.ser(version, bytes),
36121 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
36122 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
36123 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
36124 Self::LANDING_TARGET(body) => body.ser(version, bytes),
36125 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
36126 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
36127 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
36128 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
36129 Self::LOGGING_ACK(body) => body.ser(version, bytes),
36130 Self::LOGGING_DATA(body) => body.ser(version, bytes),
36131 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
36132 Self::LOG_DATA(body) => body.ser(version, bytes),
36133 Self::LOG_ENTRY(body) => body.ser(version, bytes),
36134 Self::LOG_ERASE(body) => body.ser(version, bytes),
36135 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
36136 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
36137 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
36138 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
36139 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
36140 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
36141 Self::MEMORY_VECT(body) => body.ser(version, bytes),
36142 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
36143 Self::MISSION_ACK(body) => body.ser(version, bytes),
36144 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
36145 Self::MISSION_COUNT(body) => body.ser(version, bytes),
36146 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
36147 Self::MISSION_ITEM(body) => body.ser(version, bytes),
36148 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
36149 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
36150 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
36151 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
36152 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
36153 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
36154 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
36155 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
36156 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
36157 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
36158 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
36159 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
36160 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
36161 Self::ODOMETRY(body) => body.ser(version, bytes),
36162 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
36163 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
36164 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
36165 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
36166 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
36167 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
36168 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
36169 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
36170 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
36171 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
36172 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
36173 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
36174 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
36175 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
36176 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
36177 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
36178 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
36179 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
36180 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
36181 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
36182 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
36183 Self::PARAM_SET(body) => body.ser(version, bytes),
36184 Self::PARAM_VALUE(body) => body.ser(version, bytes),
36185 Self::PING(body) => body.ser(version, bytes),
36186 Self::PLAY_TUNE(body) => body.ser(version, bytes),
36187 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
36188 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
36189 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
36190 Self::POWER_STATUS(body) => body.ser(version, bytes),
36191 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
36192 Self::RADIO_STATUS(body) => body.ser(version, bytes),
36193 Self::RAW_IMU(body) => body.ser(version, bytes),
36194 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
36195 Self::RAW_RPM(body) => body.ser(version, bytes),
36196 Self::RC_CHANNELS(body) => body.ser(version, bytes),
36197 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
36198 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
36199 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
36200 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
36201 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
36202 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
36203 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
36204 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
36205 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
36206 Self::SCALED_IMU(body) => body.ser(version, bytes),
36207 Self::SCALED_IMU2(body) => body.ser(version, bytes),
36208 Self::SCALED_IMU3(body) => body.ser(version, bytes),
36209 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
36210 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
36211 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
36212 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
36213 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
36214 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
36215 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
36216 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
36217 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
36218 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
36219 Self::SET_MODE(body) => body.ser(version, bytes),
36220 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
36221 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
36222 Self::SIM_STATE(body) => body.ser(version, bytes),
36223 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
36224 Self::STATUSTEXT(body) => body.ser(version, bytes),
36225 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
36226 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
36227 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
36228 Self::SYS_STATUS(body) => body.ser(version, bytes),
36229 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
36230 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
36231 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
36232 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
36233 Self::TIMESYNC(body) => body.ser(version, bytes),
36234 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
36235 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
36236 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
36237 Self::TUNNEL(body) => body.ser(version, bytes),
36238 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
36239 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
36240 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
36241 Self::V2_EXTENSION(body) => body.ser(version, bytes),
36242 Self::VFR_HUD(body) => body.ser(version, bytes),
36243 Self::VIBRATION(body) => body.ser(version, bytes),
36244 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36245 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
36246 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
36247 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36248 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
36249 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
36250 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
36251 Self::WINCH_STATUS(body) => body.ser(version, bytes),
36252 Self::WIND_COV(body) => body.ser(version, bytes),
36253 }
36254 }
36255 fn extra_crc(id: u32) -> u8 {
36256 match id {
36257 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36258 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
36259 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
36260 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
36261 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
36262 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
36263 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
36264 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
36265 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
36266 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
36267 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
36268 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
36269 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
36270 }
36271 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
36272 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
36273 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
36274 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
36275 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
36276 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
36277 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
36278 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
36279 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
36280 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
36281 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
36282 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
36283 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
36284 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
36285 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
36286 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
36287 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
36288 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
36289 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
36290 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
36291 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
36292 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
36293 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
36294 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
36295 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
36296 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
36297 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
36298 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
36299 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
36300 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
36301 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
36302 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => {
36303 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::EXTRA_CRC
36304 }
36305 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
36306 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::EXTRA_CRC
36307 }
36308 CUBEPILOT_RAW_RC_DATA::ID => CUBEPILOT_RAW_RC_DATA::EXTRA_CRC,
36309 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
36310 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
36311 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
36312 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
36313 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
36314 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
36315 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
36316 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
36317 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
36318 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
36319 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
36320 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
36321 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
36322 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
36323 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
36324 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
36325 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
36326 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
36327 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
36328 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
36329 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
36330 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
36331 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
36332 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
36333 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
36334 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
36335 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
36336 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
36337 }
36338 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
36339 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
36340 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
36341 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
36342 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
36343 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
36344 }
36345 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
36346 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
36347 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36348 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
36349 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
36350 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
36351 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
36352 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
36353 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
36354 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
36355 HERELINK_TELEM_DATA::ID => HERELINK_TELEM_DATA::EXTRA_CRC,
36356 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
36357 HERELINK_VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC
36358 }
36359 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
36360 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
36361 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
36362 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
36363 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
36364 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
36365 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
36366 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
36367 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
36368 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
36369 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
36370 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
36371 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
36372 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
36373 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
36374 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
36375 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
36376 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
36377 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
36378 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
36379 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
36380 }
36381 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
36382 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
36383 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
36384 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
36385 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
36386 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
36387 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
36388 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
36389 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
36390 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
36391 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
36392 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
36393 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
36394 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
36395 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
36396 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
36397 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
36398 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
36399 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
36400 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
36401 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
36402 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
36403 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
36404 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
36405 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
36406 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
36407 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
36408 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
36409 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
36410 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
36411 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
36412 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
36413 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
36414 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
36415 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
36416 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
36417 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
36418 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
36419 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
36420 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
36421 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
36422 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
36423 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
36424 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
36425 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
36426 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
36427 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
36428 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
36429 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
36430 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
36431 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
36432 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
36433 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
36434 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
36435 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
36436 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
36437 PING_DATA::ID => PING_DATA::EXTRA_CRC,
36438 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
36439 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
36440 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
36441 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36442 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
36443 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
36444 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
36445 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
36446 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
36447 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
36448 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
36449 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
36450 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
36451 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
36452 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
36453 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
36454 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
36455 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
36456 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
36457 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
36458 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
36459 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
36460 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
36461 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
36462 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
36463 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
36464 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
36465 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
36466 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
36467 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36468 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
36469 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36470 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
36471 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
36472 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
36473 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
36474 }
36475 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36476 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
36477 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
36478 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
36479 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
36480 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
36481 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
36482 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
36483 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
36484 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
36485 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
36486 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
36487 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
36488 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
36489 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
36490 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
36491 }
36492 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
36493 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
36494 }
36495 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
36496 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
36497 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
36498 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
36499 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
36500 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
36501 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
36502 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36503 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
36504 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
36505 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36506 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
36507 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
36508 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
36509 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
36510 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
36511 _ => 0,
36512 }
36513 }
36514 fn target_system_id(&self) -> Option<u8> {
36515 match self {
36516 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
36517 Self::CANFD_FRAME(inner) => Some(inner.target_system),
36518 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
36519 Self::CAN_FRAME(inner) => Some(inner.target_system),
36520 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
36521 Self::COMMAND_ACK(inner) => Some(inner.target_system),
36522 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
36523 Self::COMMAND_INT(inner) => Some(inner.target_system),
36524 Self::COMMAND_LONG(inner) => Some(inner.target_system),
36525 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(inner) => Some(inner.target_system),
36526 Self::CUBEPILOT_FIRMWARE_UPDATE_START(inner) => Some(inner.target_system),
36527 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
36528 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
36529 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
36530 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
36531 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
36532 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
36533 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
36534 Self::LOGGING_ACK(inner) => Some(inner.target_system),
36535 Self::LOGGING_DATA(inner) => Some(inner.target_system),
36536 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
36537 Self::LOG_ERASE(inner) => Some(inner.target_system),
36538 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
36539 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
36540 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
36541 Self::MISSION_ACK(inner) => Some(inner.target_system),
36542 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
36543 Self::MISSION_COUNT(inner) => Some(inner.target_system),
36544 Self::MISSION_ITEM(inner) => Some(inner.target_system),
36545 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
36546 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
36547 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
36548 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
36549 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
36550 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
36551 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
36552 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
36553 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
36554 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
36555 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
36556 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
36557 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
36558 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
36559 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
36560 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
36561 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
36562 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
36563 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
36564 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
36565 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
36566 Self::PARAM_SET(inner) => Some(inner.target_system),
36567 Self::PING(inner) => Some(inner.target_system),
36568 Self::PLAY_TUNE(inner) => Some(inner.target_system),
36569 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
36570 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
36571 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
36572 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
36573 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
36574 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
36575 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
36576 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
36577 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
36578 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
36579 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
36580 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
36581 Self::SET_MODE(inner) => Some(inner.target_system),
36582 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
36583 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
36584 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
36585 Self::TIMESYNC(inner) => Some(inner.target_system),
36586 Self::TUNNEL(inner) => Some(inner.target_system),
36587 Self::V2_EXTENSION(inner) => Some(inner.target_system),
36588 _ => None,
36589 }
36590 }
36591 fn target_component_id(&self) -> Option<u8> {
36592 match self {
36593 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
36594 Self::CANFD_FRAME(inner) => Some(inner.target_component),
36595 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
36596 Self::CAN_FRAME(inner) => Some(inner.target_component),
36597 Self::COMMAND_ACK(inner) => Some(inner.target_component),
36598 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
36599 Self::COMMAND_INT(inner) => Some(inner.target_component),
36600 Self::COMMAND_LONG(inner) => Some(inner.target_component),
36601 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(inner) => Some(inner.target_component),
36602 Self::CUBEPILOT_FIRMWARE_UPDATE_START(inner) => Some(inner.target_component),
36603 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
36604 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
36605 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
36606 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
36607 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
36608 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
36609 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
36610 Self::LOGGING_ACK(inner) => Some(inner.target_component),
36611 Self::LOGGING_DATA(inner) => Some(inner.target_component),
36612 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
36613 Self::LOG_ERASE(inner) => Some(inner.target_component),
36614 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
36615 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
36616 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
36617 Self::MISSION_ACK(inner) => Some(inner.target_component),
36618 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
36619 Self::MISSION_COUNT(inner) => Some(inner.target_component),
36620 Self::MISSION_ITEM(inner) => Some(inner.target_component),
36621 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
36622 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
36623 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
36624 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
36625 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
36626 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
36627 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
36628 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
36629 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
36630 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
36631 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
36632 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
36633 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
36634 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
36635 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
36636 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
36637 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
36638 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
36639 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
36640 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
36641 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
36642 Self::PARAM_SET(inner) => Some(inner.target_component),
36643 Self::PING(inner) => Some(inner.target_component),
36644 Self::PLAY_TUNE(inner) => Some(inner.target_component),
36645 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
36646 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
36647 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
36648 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
36649 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
36650 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
36651 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
36652 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
36653 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
36654 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
36655 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
36656 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
36657 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
36658 Self::TIMESYNC(inner) => Some(inner.target_component),
36659 Self::TUNNEL(inner) => Some(inner.target_component),
36660 Self::V2_EXTENSION(inner) => Some(inner.target_component),
36661 _ => None,
36662 }
36663 }
36664}